Skip to main content
Put on hiatus
Source Link
Alion
  • 1.3k
  • 7
  • 5

Note: I'm putting this challenge on the back burner for a indefinite time in favor of the Hierarchies challenge. Go check that or the Formic Forest out if you're interested in a Formic sequel.


Formic Functions v2 (name temporary)3: Memory

Formic Functions v2 (name temporary)

Note: I'm putting this challenge on the back burner for a indefinite time in favor of the Hierarchies challenge. Go check that or the Formic Forest out if you're interested in a Formic sequel.


Formic Functions 3: Memory

Fixed tags again
Source Link
Alion
  • 1.3k
  • 7
  • 5

The arena is a toroidal (edge wrapping) grid of hexagonal cells. It has width 1000 and height arranged in a rhombus of side length 1000. All cells start as color 1.

The arena is a toroidal (edge wrapping) grid of hexagonal cells. It has width 1000 and height 1000. All cells start as color 1.

The arena is a toroidal (edge wrapping) grid of hexagonal cells arranged in a rhombus of side length 1000. All cells start as color 1.

Modified challenge
Source Link
Alion
  • 1.3k
  • 7
  • 5

All players compete in one arena. The winner is the queen holding the most food after she has taken 88,000 10,000 [Thanks @Draco18s] turns. [Sandbox note: Amount of turns subject to change.] Ants can communicate by changing the colors of the arena squares (which can also be modified by rivals), as well as by storing messages for their peers.

The arena is a toroidal (edge wrapping) grid of hexagonal cells. It has width 1000 and height 1000. [Sandbox note: Size of arena subject to change.] All cells start as color 1.

Initially exactly 1%1% 0.5% of cells will contain food. The 100005000 pieces of food will be scattered uniformly randomly. [Sandbox note: Amount of food subject to change.] No new food will be introduced during the game.

  • Sight: Each ant sees the 7 cells in its neighborhood. It has no knowledge of any other ants outside this neighborhood. It sees the contents of each of the 7 cells (other ants and food), and also each cell's color.
  • Memory: Each ant has access to a string as its memory. It is initially empty for the queen, and must be initialized by the queen when spawning a worker. For ways to change the memory after initialization, see Output below.
  • No orientation: An ant does not know where it is or which way it faces - it has no concept of North. The neighborhood will be presented to it at a randomly rotated orientation that changes each turn so it cannot even walk in a straight line unless it has colors to guide it. (Making the same move every turn will result in a random walk rather than a straight line.)
  • Moving, color marking, producing workers and transferring food: See Output below.
  • Immortality: These are highland ants that cannot die. You can confuse rival ants by changing the colors around them, or constrain them from moving by surrounding them with 6 ants of your own, but they cannot be harmed apart from this. [Should ants be able to die? If so, how?]
  • Carrying food: A worker can carry up to 1 piece of food. A queen can carry an arbitrary amount of food.

Functions must be fully deterministic. When called with a given input, they must return the same output every time. A function must not access global variables and must not store state between turns in other ways than through the provided memory string. It may use built in functions that do not involve storing state or accessing data from the outside. For example, the use of Math.abs() is fine, but Date.getTime(), Math.random() must not be used.

[Is 8 colors perhaps too many?]

[Sandbox note: Should ants be able to read rivals' memories?][Should ants be able to read rivals' memories? This would cause rampant edit wars. Rejected.]

If spawn is a string, a worker ant is created on the indicated cell. The new worker will have its memory initialized to that string. The string cannot be longer than 65,536256 characters. Only a queen can create a new worker, and only if she has food, as this costs one piece of food per worker.

If memory is a string, the executing ant will have its memory immediately changed to that string. The string cannot be longer than 65,536 characters for the queen, and 256 characters for workers. YouAn ant may change yourits memory while also performing a different action - changing memory does not take a turn.

[Sandbox note: Is 65,536 characters a good number to pick for the max length of memory?][Should changing own memory take a turn?]

[Should ants be able to send a message directly to another ant's inbox? For example, a message could look like this: {title:"help", content:view_array_of_sender}. An ant should also be able to perform an action while sending a message, otherwise the described behavior could be emulated.]

[Should ants be able to see the age of an ant? This behavior will often be emulated with memory. Is there a reason not to do that?]

[Is 65,536 characters a good number to pick for the max length of memory? Thanks to @Draco18s's and @dzaima's advice, workers now have significantly less memory than a queen.]

[Missed any?]

[Good max number of players?]

[Enough time?]

[Sandbox note: Did I miss any?][Did I miss any?]

[Sandbox note: Scoring mechanism subject to change.][Scoring mechanism subject to change.]

[Sandbox note: New feature/modification recommendations are very welcome! I want this challenge to be as different from the original Formic as possible, while keeping the spirit. For example, I'm considering adding mortality, but have no idea how that should look][New feature/modification recommendations are very welcome! I want this challenge to be as different from the original Formic as possible, while keeping its spirit.]

All players compete in one arena. The winner is the queen holding the most food after she has taken 8,000 turns. [Sandbox note: Amount of turns subject to change.] Ants can communicate by changing the colors of the arena squares (which can also be modified by rivals), as well as by storing messages for their peers.

The arena is a toroidal (edge wrapping) grid of hexagonal cells. It has width 1000 and height 1000. [Sandbox note: Size of arena subject to change.] All cells start as color 1.

Initially exactly 1% of cells will contain food. The 10000 pieces of food will be scattered uniformly randomly. [Sandbox note: Amount of food subject to change.] No new food will be introduced during the game.

  • Sight: Each ant sees the 7 cells in its neighborhood. It has no knowledge of any other ants outside this neighborhood. It sees the contents of each of the 7 cells (other ants and food), and also each cell's color.
  • Memory: Each ant has access to a string as its memory. It is initially empty for the queen, and must be initialized by the queen when spawning a worker. For ways to change the memory after initialization, see Output below.
  • No orientation: An ant does not know where it is or which way it faces - it has no concept of North. The neighborhood will be presented to it at a randomly rotated orientation that changes each turn so it cannot even walk in a straight line unless it has colors to guide it. (Making the same move every turn will result in a random walk rather than a straight line.)
  • Moving, color marking, producing workers and transferring food: See Output below.
  • Immortality: These are highland ants that cannot die. You can confuse rival ants by changing the colors around them, or constrain them from moving by surrounding them with 6 ants of your own, but they cannot be harmed apart from this.
  • Carrying food: A worker can carry up to 1 piece of food. A queen can carry an arbitrary amount of food.

A function must not access global variables and must not store state between turns in other ways than through the provided memory string. It may use built in functions that do not involve storing state or accessing data from outside. For example, the use of Math.abs() is fine, but Date.getTime(), Math.random() must not be used.

[Sandbox note: Should ants be able to read rivals' memories?]

If spawn is a string, a worker ant is created on the indicated cell. The new worker will have its memory initialized to that string. The string cannot be longer than 65,536 characters. Only a queen can create a new worker, and only if she has food, as this costs one piece of food per worker.

If memory is a string, the executing ant will have its memory immediately changed to that string. The string cannot be longer than 65,536 characters. You may change your memory while performing a different action - changing memory does not take a turn.

[Sandbox note: Is 65,536 characters a good number to pick for the max length of memory?]

[Sandbox note: Did I miss any?]

[Sandbox note: Scoring mechanism subject to change.]

[Sandbox note: New feature/modification recommendations are very welcome! I want this challenge to be as different from the original Formic as possible, while keeping the spirit. For example, I'm considering adding mortality, but have no idea how that should look]

All players compete in one arena. The winner is the queen holding the most food after she has taken 8,000 10,000 [Thanks @Draco18s] turns. Ants can communicate by changing the colors of the arena squares (which can also be modified by rivals), as well as by storing messages for their peers.

The arena is a toroidal (edge wrapping) grid of hexagonal cells. It has width 1000 and height 1000. All cells start as color 1.

Initially exactly 1% 0.5% of cells will contain food. The 5000 pieces of food will be scattered uniformly randomly. No new food will be introduced during the game.

  • Sight: Each ant sees the 7 cells in its neighborhood. It has no knowledge of any other ants outside this neighborhood. It sees the contents of each of the 7 cells (other ants and food), and also each cell's color.
  • Memory: Each ant has access to a string as its memory. It is initially empty for the queen, and must be initialized by the queen when spawning a worker. For ways to change the memory after initialization, see Output below.
  • No orientation: An ant does not know where it is or which way it faces - it has no concept of North. The neighborhood will be presented to it at a randomly rotated orientation that changes each turn so it cannot even walk in a straight line unless it has colors to guide it. (Making the same move every turn will result in a random walk rather than a straight line.)
  • Moving, color marking, producing workers and transferring food: See Output below.
  • Immortality: These are highland ants that cannot die. You can confuse rival ants by changing the colors around them, or constrain them from moving by surrounding them with 6 ants of your own, but they cannot be harmed apart from this. [Should ants be able to die? If so, how?]
  • Carrying food: A worker can carry up to 1 piece of food. A queen can carry an arbitrary amount of food.

Functions must be fully deterministic. When called with a given input, they must return the same output every time. A function must not access global variables and must not store state between turns in other ways than through the provided memory string. It may use built in functions that do not involve storing state or accessing data from the outside. For example, the use of Math.abs() is fine, but Date.getTime(), Math.random() must not be used.

[Is 8 colors perhaps too many?]

[Should ants be able to read rivals' memories? This would cause rampant edit wars. Rejected.]

If spawn is a string, a worker ant is created on the indicated cell. The new worker will have its memory initialized to that string. The string cannot be longer than 256 characters. Only a queen can create a new worker, and only if she has food, as this costs one piece of food per worker.

If memory is a string, the executing ant will have its memory immediately changed to that string. The string cannot be longer than 65,536 characters for the queen, and 256 characters for workers. An ant may change its memory while also performing a different action - changing memory does not take a turn.

[Should changing own memory take a turn?]

[Should ants be able to send a message directly to another ant's inbox? For example, a message could look like this: {title:"help", content:view_array_of_sender}. An ant should also be able to perform an action while sending a message, otherwise the described behavior could be emulated.]

[Should ants be able to see the age of an ant? This behavior will often be emulated with memory. Is there a reason not to do that?]

[Is 65,536 characters a good number to pick for the max length of memory? Thanks to @Draco18s's and @dzaima's advice, workers now have significantly less memory than a queen.]

[Missed any?]

[Good max number of players?]

[Enough time?]

[Did I miss any?]

[Scoring mechanism subject to change.]

[New feature/modification recommendations are very welcome! I want this challenge to be as different from the original Formic as possible, while keeping its spirit.]

added 283 characters in body
Source Link
Alion
  • 1.3k
  • 7
  • 5
Loading
Source Link
Alion
  • 1.3k
  • 7
  • 5
Loading