Theme editor

  • RequestStream Movies, TV shows and anime streaming • 1 week trial
  • LewdCorner Update
    For now, mime and apollo have full control over LC and will be handling site decisions going forward. I’m stepping back from making site changes for now and letting them decide how to move LC forward. - Jack Of Blades
    Read More

Anti-Social & Lurker - Hideout spot

  • Thread starter Thread starter Axois
  • Start date Start date
  • Replies Replies 172K
  • Views Views 5M

Attachments

You must be registered for see attachments list

Attachments

You must be registered for see attachments list

Attachments

You must be registered for see attachments list

Attachments

You must be registered for see attachments list
You must be registered to see attachments


nah, it is the BEST catch! it comes with this nice clinic with some sexy midget ladies i keep trying to impregnate
what do I have to do ? D=
 
OK, I'm sitting on 2475 LC coins that needs new owners!

Want some of these coins? We're having a lightning bounty in my DMs.

You must be registered to see attachments


I'll be awarding the first 5 whose images I really like!

Images should be DMed to Me to me.

As always, follow the site rules.
 

Attachments

You must be registered for see attachments list
Yeah but mummy won't let me play with the big tools now after what happened last time
Don't tell me you forgot to wear the whole armor before play with tools!
You must be registered to see attachments
 

Attachments

You must be registered for see attachments list
Tigger Tigger Wave GIF
Winni Tigger GIF


Good morning afternoon evening everyone!

Is there anyone here who hasn't successfully survived monday?



It is interesting, though I've tried something similar on a javascript AI and immediately realized a whole lot of implementation problems.
It works well as a piece limited, but in the greater whole, the AI chooses implementation versions that do not really work.
For instance, I had it generate a 3x3 gameboard with card objects created based on a prototype object that is supposed to have 4 random values from 1-9 and functions to access its neighbors dynamically based on the current position.

JavaScript:
// Prototype object for the card
const cardPrototype = {
  values: Array.from({ length: 4 }, () => Math.floor(Math.random() * 9) + 1),
  top: function() { return gameboard[this.row - 1][this.col]; },
  bottom: function() { return gameboard[this.row + 1][this.col]; },
  left: function() { return gameboard[this.row][this.col - 1]; },
  right: function() { return gameboard[this.row][this.col + 1]; }
};

// Create a 3x3 gameboard with card objects
const gameboard = Array.from({ length: 3 }, () =>
  Array.from({ length: 3 }, () => Object.create(cardPrototype))
);

// Assign row and column properties to each card
gameboard.forEach((row, i) => {
  row.forEach((card, j) => {
    card.row = i;
    card.col = j;
  });
});

While this isn't wrong, that's not really dynamic. It works if you make sure that you tell the card it's new position every time you change on what tile it is,
but it cannot dynamically detect the neighbors.
A dynamic solution would be to use a function to access the gameboard, find the current row & column indexes and then use those to calculate the neighbors. This also only works on a fixed gameboard size with fixed dimensions, since the gameboard is automatically divided into rows and columns.
This also fixes how the gameboard's tiles are accessible, because it predefines the size of the gameboard during creation.

Instead, a different and more flexible solution would've been to have the gameboard creates as containing an array of x tiles, giving the gameboard a width & height and rather than using direct +/- operations on fixed tiles, using modulo to dynamically access the correct neighbors even if the size & width change.

So it's a correct solution that might not work in the actual project, due to restrictions in what choices it has made for the implementation.

I think it's a nifty thing for simple and straightforward operations, but I don't think it can, in the solution, correctly account of implentation-based restrictions in how it's going to have to interact in the greater whole. The particular choice made by the AI does provide the fastest solution (predefined values, even less math) but it's not necessarily giving the solution that would actually work with the project.

I wonder if anyone managed to get it to work with something like PixiJS and create a simple visual game - because I wonder if the AI would detect the necessary restrictions in rendering hierarchy. :unsure:

I think some of the things to consider here, is that AI should be used to help, rather than to build completely (at this stage at least) and, like you say - it's not wrong necessarily, but just not ideal. In my experience, AI won't ever give you ideal since that's where some of our humanity and problem solving comes in. Also, remember it's an iterative process, so give it your feedback to improve it. Just like you would if you hired an outside developer/artist that doesn't do what you want.

That said, can I ask what AI you were using to Generate? Because that changes the output MASSIVELY. Let me share with you what I've just done in GPT based on your code. For reference, both of the below are ChatGPT 4o and both are brand new unique conversatons.

Can you improve this Javascript based on the users request?

For instance, I had it generate a 3x3 gameboard with card objects created based on a prototype object that is supposed to have 4 random values from 1-9 and functions to access its neighbors dynamically based on the current position. //

Prototype object for the card const cardPrototype = { values: Array.from({ length: 4 }, () => Math.floor(Math.random() * 9) + 1), top: function() { return gameboard[this.row - 1][this.col]; }, bottom: function() { return gameboard[this.row + 1][this.col]; }, left: function() { return gameboard[this.row][this.col - 1]; }, right: function() { return gameboard[this.row][this.col + 1]; } }; // Create a 3x3 gameboard with card objects const gameboard = Array.from({ length: 3 }, () => Array.from({ length: 3 }, () => Object.create(cardPrototype)) ); // Assign row and column properties to each card gameboard.forEach((row, i) => { row.forEach((card, j) => { card.row = i; card.col = j; }); });
Sure, I'll make a few improvements to the JavaScript code to enhance clarity, functionality, and ensure it adheres to best practices.

  1. The values array should be generated dynamically for each card object.
  2. The neighbor functions should handle boundary conditions gracefully.
  3. Use Object.assign to create card objects to ensure the values array is unique for each card.
Here is the improved code:

JavaScript:
// Prototype object for the card
const cardPrototype = {
  init: function(row, col) {
    this.row = row;
    this.col = col;
    this.values = Array.from({ length: 4 }, () => Math.floor(Math.random() * 9) + 1);
  },
  top: function() {
    return this.row > 0 ? gameboard[this.row - 1][this.col] : null;
  },
  bottom: function() {
    return this.row < gameboard.length - 1 ? gameboard[this.row + 1][this.col] : null;
  },
  left: function() {
    return this.col > 0 ? gameboard[this.row][this.col - 1] : null;
  },
  right: function() {
    return this.col < gameboard[this.row].length - 1 ? gameboard[this.row][this.col + 1] : null;
  }
};

// Create a 3x3 gameboard with card objects
const gameboard = Array.from({ length: 3 }, (_, row) =>
  Array.from({ length: 3 }, (_, col) => {
    const card = Object.create(cardPrototype);
    card.init(row, col);
    return card;
  })
);

// For demonstration: log the gameboard and one card's neighbors
console.log(gameboard);
console.log('Neighbors of card at (1,1):', gameboard[1][1].top(), gameboard[1][1].bottom(), gameboard[1][1].left(), gameboard[1][1].right());

Changes and Improvements:​

  1. Dynamic values Array: The values array is now dynamically generated for each card during initialization.
  2. Boundary Handling: The neighbor functions (top, bottom, left, right) now check boundaries to avoid accessing undefined array elements.
  3. Initialization Method: Added an init method to the prototype for setting up row, col, and values properties.
  4. Object Creation: Used Object.create and card.init to ensure each card gets unique values.
This code should now correctly create a 3x3 gameboard with cards having unique values and correctly handle neighbor lookups.

A User is discussing trouble using AI Language Models to write code for a Java project. As I am unfamiliar with Java, can you take a look at his query below and perhaps improve his code to something more appropriate? It is interesting, though I've tried something similar on a javascript AI and immediately realized a whole lot of implementation problems. It works well as a piece limited, but in the greater whole, the AI chooses implementation versions that do not really work. For instance, I had it generate a 3x3 gameboard with card objects created based on a prototype object that is supposed to have 4 random values from 1-9 and functions to access its neighbors dynamically based on the current position. This is the result // Prototype object for the card const cardPrototype = { values: Array.from({ length: 4 }, () => Math.floor(Math.random() * 9) + 1), top: function() { return gameboard[this.row - 1][this.col]; }, bottom: function() { return gameboard[this.row + 1][this.col]; }, left: function() { return gameboard[this.row][this.col - 1]; }, right: function() { return gameboard[this.row][this.col + 1]; } }; // Create a 3x3 gameboard with card objects const gameboard = Array.from({ length: 3 }, () => Array.from({ length: 3 }, () => Object.create(cardPrototype)) ); // Assign row and column properties to each card gameboard.forEach((row, i) => { row.forEach((card, j) => { card.row = i; card.col = j; }); }); While this isn't wrong, that's not really dynamic. It works if you make sure that you tell the card it's new position every time you change on what tile it is, but it cannot dynamically detect the neighbors. A dynamic solution would be to use a function to access the gameboard, find the current row & column indexes and then use those to calculate the neighbors. This also only works on a fixed gameboard size with fixed dimensions, since the gameboard is automatically divided into rows and columns. This also fixes how the gameboard's tiles are accessible, because it predefines the size of the gameboard during creation. Instead, a different and more flexible solution would've been to have the gameboard creates as containing an array of x tiles, giving the gameboard a width & height and rather than using direct +/- operations on fixed tiles, using modulo to dynamically access the correct neighbors even if the size & width change. So it's a correct solution that might not work in the actual project, due to restrictions in what choices it has made for the implementation. I think it's a nifty thing for simple and straightforward operations, but I don't think it can, in the solution, correctly account of implentation-based restrictions in how it's going to have to interact in the greater whole. The particular choice made by the AI does provide the fastest solution (predefined values, even less math) but it's not necessarily giving the solution that would actually work with the project. I wonder if anyone managed to get it to work with something like PixiJS and create a simple visual game - because I wonder if the AI would detect the necessary restrictions in rendering hierarchy.
It seems the user is trying to dynamically handle the position of cards on a gameboard in a JavaScript context, and they would like a more flexible solution that doesn't rely on fixed positions. Here's an improved version of the code that dynamically calculates the neighbours and can adapt to changes in the gameboard's size:
JavaScript:
// Card constructor function
function Card(row, col, gameboard) {
  this.row = row;
  this.col = col;
  this.gameboard = gameboard;
  this.values = Array.from({ length: 4 }, () => Math.floor(Math.random() * 9) + 1);
}

Card.prototype.getNeighbour = function (dRow, dCol) {
  const newRow = this.row + dRow;
  const newCol = this.col + dCol;
 
  if (newRow >= 0 && newRow < this.gameboard.length && newCol >= 0 && newCol < this.gameboard[0].length) {
    return this.gameboard[newRow][newCol];
  }
  return null;
};

Card.prototype.top = function () {
  return this.getNeighbour(-1, 0);
};

Card.prototype.bottom = function () {
  return this.getNeighbour(1, 0);
};

Card.prototype.left = function () {
  return this.getNeighbour(0, -1);
};

Card.prototype.right = function () {
  return this.getNeighbour(0, 1);
};

// Function to create a gameboard
function createGameboard(rows, cols) {
  const gameboard = Array.from({ length: rows }, (_, row) =>
    Array.from({ length: cols }, (_, col) => new Card(row, col, gameboard))
  );
 
  // Assign the gameboard reference after creation
  gameboard.forEach(row => row.forEach(card => card.gameboard = gameboard));
 
  return gameboard;
}

// Create a 3x3 gameboard
const gameboard = createGameboard(3, 3);

// Example: Access neighbours of the card at (1, 1)
const card = gameboard[1][1];
console.log('Top:', card.top());
console.log('Bottom:', card.bottom());
console.log('Left:', card.left());
console.log('Right:', card.right());

Explanation:​

  1. Card Constructor: The Card function is used to create card objects with dynamic row and column properties. Each card also holds a reference to the gameboard it belongs to.
  2. getNeighbour Method: This method calculates the new row and column indices based on the current position and checks if the new indices are within bounds. If they are, it returns the neighbouring card; otherwise, it returns null.
  3. Direction Methods: The top, bottom, left, and right methods use getNeighbour to find the card in the corresponding direction.
  4. createGameboard Function: This function creates a gameboard of the specified size and populates it with cards. Each card is initially created without a reference to the gameboard, but after the gameboard is fully created, each card's gameboard reference is updated.
This approach allows the gameboard to dynamically calculate neighbours regardless of the board size and ensures that the card objects are aware of their own positions and the gameboard they belong to. This should address the user's concerns about flexibility and dynamic interaction in the project.

So, I'm not sure how much credit you give those responses? I'm not trying to "prove you wrong" or anything like that, just trying to say "have you tried this?" - you might look at this code and still call it bullshit, since I don't really know what I'm talking about when it comes to Java! I just thought it'd be interesting to get your perspective on it.
 

Attachments

You must be registered for see attachments list
Just mingle into the conversation. And happy to see you here.
I participate, I participate, as best I can, but what's the point :v
 
You must be registered to see attachments


nah, it is the BEST catch! it comes with this nice clinic with some sexy midget ladies i keep trying to impregnate
You'll put a bun in their ovens.. I'm quite sure of that. Oh god.. I just typed that out. I'm asking myself..

You must be registered to see attachments
 

Attachments

You must be registered for see attachments list
be the 12 000 message here C=
C = 1tb ssd
You must be registered to see attachments

You must be registered to see attachments


high chance your posts will get deleted anyway cause
 

Attachments

You must be registered for see attachments list
OK, I'm sitting on 2475 LC coins that needs new owners!

Want some of these coins? We're having a lightning bounty in my DMs.

You must be registered to see attachments


I'll be awarding the first 5 whose images I really like!

Images should be DMed to Me to me.

As always, follow the site rules.
If I just send @Slumdum your way.. can I collect the coins right now? I mean, game over.. I win all the coins.
 
C = 1tb ssd
You must be registered to see attachments

You must be registered to see attachments


high chance your posts will get deleted anyway cause
but I come to this thread, and I see that you are at 11,999 messages it was too tempting
 
Back
Top Bottom