t >>clipped?
${ WIDTH HEIGHT } >>pref-dim
initial-population random-boids >>boids
- initial-behaviors >>behaviours
+ initial-behaviors >>behaviors
initial-dt >>dt ;
M: boids-gadget ungraft*
{ "astar" astar }
}
{ $description "Build an astar object from the given quotations. The "
- { $snippet "neighbors" } " one builds the list of neighbours. The "
+ { $snippet "neighbors" } " one builds the list of neighbors. The "
{ $snippet "cost" } " and " { $snippet "heuristic" } " ones represent "
"respectively the cost for transitioning from a node to one of its neighbor, "
"and the underestimated cost for going from a node to the target. This solution "
TUPLE: astar-simple < astar cost heuristic neighbors ;
M: astar-simple cost cost>> call( n1 n2 -- c ) ;
M: astar-simple heuristic heuristic>> call( n1 n2 -- c ) ;
-M: astar-simple neighbors neighbours>> call( n -- neighbours ) ;
+M: astar-simple neighbors neighbors>> call( n -- neighbors ) ;
TUPLE: bfs < astar neighbors ;
M: bfs cost 3drop 1 ;
M: bfs heuristic 3drop 0 ;
-M: bfs neighbors neighbours>> at ;
+M: bfs neighbors neighbors>> at ;
TUPLE: dijkstra < astar costs ;
M: dijkstra cost costs>> swapd at at ;
! replacing the black tiles in a row measuring five units in length.
! How many different ways can the black tiles in a row measuring fifty units in
-! length be replaced if colors cannot be mixed and at least one coloured tile
+! length be replaced if colors cannot be mixed and at least one colored tile
! must be used?
:: neighbors ( index world -- # )
index [ 1 - ] [ 1 + ] bi [ world ?nth ] bi@ bool-sum ;
-: count-neighbors ( world -- neighbours )
+: count-neighbors ( world -- neighbors )
[ length <iota> ] keep [ neighbors ] curry map ;
: life-law ( alive? neighbors -- alive? )