Boids: Difference between revisions
mNo edit summary |
No edit summary |
||
(12 intermediate revisions by 6 users not shown) | |||
Line 2: | Line 2: | ||
A [[wp:Boids|Boids]] algorithm simulates the flocking behavior of birds. This task requires the creation of a graphical or purely textual simulation of a flock of birds navigating the cave with obstacles depicted below. |
A [[wp:Boids|Boids]] algorithm simulates the flocking behavior of birds. This task requires the creation of a graphical or purely textual simulation of a flock of birds navigating the cave with obstacles depicted below. |
||
<div style="font-size: .8em;"><pre> |
|||
.......###############............................................................... |
|||
.......###############............................................................... |
.......###############............................................................... |
||
......#################.............................................................. |
......#################.............................................................. |
||
Line 17: | Line 18: | ||
............................................................#################........ |
............................................................#################........ |
||
...........................................................###################....... |
...........................................................###################....... |
||
............................................................#################........ |
............................................................#################........ |
||
</pre></div> |
|||
If you implement a purely textual simulation, this is a possible board representation, where "O" are the boids that should go toward the right, "#" are fixed walls that should be avoided by the boids, and "." is free space (using a space is also acceptable for free space, if you add some kind of frame around the board). |
If you implement a purely textual simulation, this is a possible board representation, where "O" are the boids that should go toward the right, "#" are fixed walls that should be avoided by the boids, and "." is free space (using a space is also acceptable for free space, if you add some kind of frame around the board). |
||
Line 29: | Line 31: | ||
=={{header|C}}== |
=={{header|C}}== |
||
See [[Boids/C]] |
See [[Boids/C]] |
||
⚫ | |||
See [[Boids/Go]] |
|||
=={{header|Java}}== |
=={{header|Java}}== |
||
See [[Boids/Java]] |
See [[Boids/Java]] |
||
=={{header|Julia}}== |
|||
See [[Boids/Julia]] |
|||
=={{header|Nim}}== |
|||
See [[Boids/Nim]] |
|||
=={{header|Phix}}== |
|||
See [[Boids/Phix]]<br> |
|||
Screenshot: [http://phix.x10.mx/shots/boids.png http://phix.x10.mx/shots/boids.png] |
|||
=={{header|Wren}}== |
|||
See [[Boids/Wren]] |
|||
⚫ | |||
[http://hashcollision.org/whalesong/examples/boid/boid.html Here] is the result. |
|||
The Whalesong compiler was used to compile [http://hashcollision.org/whalesong/examples/boid/boid.rkt the Racket source] into JavaScript. |
Latest revision as of 11:33, 28 July 2023
A Boids algorithm simulates the flocking behavior of birds. This task requires the creation of a graphical or purely textual simulation of a flock of birds navigating the cave with obstacles depicted below.
.......###############............................................................... .......###############............................................................... ......#################.............................................................. O......###############............................................................... OO.....###############............................................................... OO.....###############....................#.........................#................ OO......#############...................#####...................#########............ OO......#############...................#####..................###########........... OO.......###########...................#######................#############.......... OO.........#######......................#####................###############......... OO............#.........................#####...............#################........ OO........................................#.................#################........ O...........................................................#################........ ............................................................#################........ ...........................................................###################....... ............................................................#################........
If you implement a purely textual simulation, this is a possible board representation, where "O" are the boids that should go toward the right, "#" are fixed walls that should be avoided by the boids, and "." is free space (using a space is also acceptable for free space, if you add some kind of frame around the board).
A simulation that doesn't contain obstacles but only shows flocking behavior is acceptable.
- See also
C
See Boids/C
Go
See Boids/Go
Java
See Boids/Java
Julia
See Boids/Julia
Nim
See Boids/Nim
Phix
See Boids/Phix
Screenshot: http://phix.x10.mx/shots/boids.png
Wren
See Boids/Wren