]> gitweb.factorcode.org Git - factor.git/commitdiff
Harmonize spelling
authorGiftpflanze <gifti@tools.wmflabs.org>
Tue, 23 Aug 2022 15:36:55 +0000 (17:36 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 23 Aug 2022 21:15:17 +0000 (14:15 -0700)
26 files changed:
basis/promises/promises-docs.factor
extra/boids/boids.factor
extra/boids/simulation/simulation.factor
extra/jamshred/player/player.factor
extra/jamshred/tunnel/tunnel-tests.factor
extra/jamshred/tunnel/tunnel.factor
extra/maze/maze.factor
extra/path-finding/path-finding-docs.factor
extra/path-finding/path-finding-tests.factor
extra/path-finding/path-finding.factor
extra/pcre/pcre-tests.factor
extra/project-euler/039/039.factor
extra/project-euler/070/070.factor
extra/project-euler/100/100.factor
extra/project-euler/116/116.factor
extra/project-euler/151/151.factor
extra/project-euler/190/190.factor
extra/raylib/raylib.factor
extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor
extra/rosetta-code/knapsack/knapsack.factor
extra/rosetta-code/multiplication-tables/multiplication-tables.factor
extra/rosetta-code/one-d-cellular/one-d-cellular.factor
extra/tetris/board/board.factor
extra/tetris/game/game.factor
extra/tetris/gl/gl.factor
extra/tetris/tetromino/tetromino.factor

index 9c26923114a8c8d6f17a415a5f98f2e7a5d33a6b..db45ca339c4851aa3c652ca3ab301a012016e44c 100644 (file)
@@ -5,7 +5,7 @@ IN: promises
 
 HELP: <promise>
 { $values { "quot" { $quotation ( -- x ) } } { "promise" "a promise object" } }
-{ $description "Creates a promise to return a value. When forced this quotation is called and the value returned. The value is memorised so that calling " { $link force } " again does not call the quotation again, instead the previous value is returned directly." } ;
+{ $description "Creates a promise to return a value. When forced this quotation is called and the value returned. The value is memorized so that calling " { $link force } " again does not call the quotation again, instead the previous value is returned directly." } ;
 
 HELP: force
 { $values { "promise" "a promise object" } { "value" "a factor object" } }
index 42190abd22defdbc1746590d73a99c3cc56c6e6e..7ca546fba50069332ff521b5c6bcccbaafd55579 100644 (file)
@@ -13,12 +13,12 @@ ui.gadgets.sliders ui.render ui.tools.common ;
 QUALIFIED-WITH: models.range mr
 IN: boids
 
-TUPLE: boids-gadget < gadget paused boids behaviours dt ;
+TUPLE: boids-gadget < gadget paused boids behaviors dt ;
 
 CONSTANT: initial-population 100
 CONSTANT: initial-dt 5
 
-: initial-behaviours ( -- seq )
+: initial-behaviors ( -- seq )
     1.0 75 -0.1 <cohesion>
     1.0 40 -0.5 <alignment>
     1.0 25 -1.0 <separation>
@@ -29,7 +29,7 @@ CONSTANT: initial-dt 5
         t >>clipped?
         ${ WIDTH HEIGHT } >>pref-dim
         initial-population random-boids >>boids
-        initial-behaviours >>behaviours
+        initial-behaviors >>behaviours
         initial-dt >>dt ;
 
 M: boids-gadget ungraft*
@@ -56,7 +56,7 @@ M: boids-gadget draw-gadget* ( boids-gadget -- )
     boids>> draw-boids ;
 
 : iterate-system ( boids-gadget -- )
-    dup [ boids>> ] [ behaviours>> ] [ dt>> ] tri
+    dup [ boids>> ] [ behaviors>> ] [ dt>> ] tri
     simulate >>boids drop ;
 
 :: start-boids-thread ( gadget -- )
@@ -160,7 +160,7 @@ TUPLE: boids-frame < pack ;
     boids-gadget simulation-panel
     add-gadget
 
-    boids-gadget behaviours>>
+    boids-gadget behaviors>>
     [ behavior-panel add-gadget ] each
 
     { 5 5 } <border> add-gadget ;
index b2df09f8c060ddf9cbcef1be6295209df79ee222..1310d2ddc6ae5f32e81580716fe15cd9b3938363 100644 (file)
@@ -8,7 +8,7 @@ IN: boids.simulation
 CONSTANT: WIDTH 512
 CONSTANT: HEIGHT 512
 
-TUPLE: behaviour
+TUPLE: behavior
     { weight float }
     { radius float }
     { angle-cos float } ;
@@ -41,28 +41,28 @@ C: <boid> boid
 : in-view? ( self other angle-cos -- ? )
     [ relative-angle ] dip >= ; inline
 
-:: within-neighborhood? ( self other behaviour -- ? )
+:: within-neighborhood? ( self other behavior -- ? )
     self other {
         [ eq? not ]
-        [ behaviour radius>> in-radius? ]
-        [ behaviour angle-cos>> in-view? ]
+        [ behavior radius>> in-radius? ]
+        [ behavior angle-cos>> in-view? ]
     } 2&& ; inline
 
-:: neighbors ( boid boids behaviour -- neighbors )
-    boid boids [ behaviour within-neighborhood? ] with filter ;
+:: neighbors ( boid boids behavior -- neighbors )
+    boid boids [ behavior within-neighborhood? ] with filter ;
 
-GENERIC: force ( neighbors boid behaviour -- force )
+GENERIC: force ( neighbors boid behavior -- force )
 
-:: (force) ( boid boids behaviour -- force )
-    boid boids behaviour neighbors
-    [ { 0.0 0.0 } ] [ boid behaviour force ] if-empty ;
+:: (force) ( boid boids behavior -- force )
+    boid boids behavior neighbors
+    [ { 0.0 0.0 } ] [ boid behavior force ] if-empty ;
 
 : wrap-pos ( pos -- pos )
     WIDTH HEIGHT 2array [ [ + ] keep mod ] 2map ;
 
-:: simulate ( boids behaviours dt -- boids )
+:: simulate ( boids behaviors dt -- boids )
     boids [| boid |
-        boid boids behaviours
+        boid boids behaviors
         [ [ (force) ] keep weight>> v*n ] 2with map vsum :> a
 
         boid vel>> a dt v*n v+ normalize :> vel
@@ -78,21 +78,21 @@ GENERIC: force ( neighbors boid behaviour -- force )
         <boid>
     ] replicate ;
 
-TUPLE: cohesion < behaviour ;
-TUPLE: alignment < behaviour ;
-TUPLE: separation < behaviour ;
+TUPLE: cohesion < behavior ;
+TUPLE: alignment < behavior ;
+TUPLE: separation < behavior ;
 
 C: <cohesion> cohesion
 C: <alignment> alignment
 C: <separation> separation
 
-M: cohesion force ( neighbors boid behaviour -- force )
+M: cohesion force ( neighbors boid behavior -- force )
     drop [ [ pos>> ] map vavg ] [ pos>> ] bi* v- normalize ;
 
-M: alignment force ( neighbors boid behaviour -- force )
+M: alignment force ( neighbors boid behavior -- force )
     2drop [ vel>> ] map vsum normalize ;
 
-M:: separation force ( neighbors boid behaviour -- force )
-    behaviour radius>> :> r
+M:: separation force ( neighbors boid behavior -- force )
+    behavior radius>> :> r
     boid pos>> neighbors
     [ pos>> v- [ normalize ] [ r v/n ] bi v- ] with map vsum ;
index f75198e1ba9a49c72e2fc375604acec012089217..1c691bcb705972f3cbe2bb7fb22a8de43ae5e478 100644 (file)
@@ -81,14 +81,14 @@ CONSTANT: max-speed 30.0
 : almost-to-collision ( player -- distance )
     distance-to-collision 0.1 - dup 0 < [ drop 0 ] when ;
 
-: from ( player -- radius distance-from-centre )
+: from ( player -- radius distance-from-center )
     [ nearest-segment>> dup radius>> swap ] [ location>> ] bi
-    distance-from-centre ;
+    distance-from-center ;
 
 : distance-from-wall ( player -- distance ) from - ;
-: fraction-from-centre ( player -- fraction ) from swap / ;
+: fraction-from-center ( player -- fraction ) from swap / ;
 : fraction-from-wall ( player -- fraction )
-    fraction-from-centre 1 swap - ;
+    fraction-from-center 1 swap - ;
 
 : update-nearest-segment2 ( heading player -- )
     2dup distance-to-heading-segment-area 0 <= [
index 4a215d068462138c948436017783fc00762f844d..4f536fb330bcbee40860877638a3e576b8975f9d 100644 (file)
@@ -9,14 +9,14 @@ IN: jamshred.tunnel.tests
 : test-segment-oint ( -- oint )
     { 0 0 0 } { 0 0 -1 } { 0 1 0 } { -1 0 0 } <oint> ;
 
-{ { -1 0 0 } } [ test-segment-oint { 1 0 0 } vector-to-centre ] unit-test
-{ { 1 0 0 } } [ test-segment-oint { -1 0 0 } vector-to-centre ] unit-test
-{ { 0 -1 0 } } [ test-segment-oint { 0 1 0 } vector-to-centre ] unit-test
-{ { 0 1 0 } } [ test-segment-oint { 0 -1 0 } vector-to-centre ] unit-test
-{ { -1 0 0 } } [ test-segment-oint { 1 0 -1 } vector-to-centre ] unit-test
-{ { 1 0 0 } } [ test-segment-oint { -1 0 -1 } vector-to-centre ] unit-test
-{ { 0 -1 0 } } [ test-segment-oint { 0 1 -1 } vector-to-centre ] unit-test
-{ { 0 1 0 } } [ test-segment-oint { 0 -1 -1 } vector-to-centre ] unit-test
+{ { -1 0 0 } } [ test-segment-oint { 1 0 0 } vector-to-center ] unit-test
+{ { 1 0 0 } } [ test-segment-oint { -1 0 0 } vector-to-center ] unit-test
+{ { 0 -1 0 } } [ test-segment-oint { 0 1 0 } vector-to-center ] unit-test
+{ { 0 1 0 } } [ test-segment-oint { 0 -1 0 } vector-to-center ] unit-test
+{ { -1 0 0 } } [ test-segment-oint { 1 0 -1 } vector-to-center ] unit-test
+{ { 1 0 0 } } [ test-segment-oint { -1 0 -1 } vector-to-center ] unit-test
+{ { 0 -1 0 } } [ test-segment-oint { 0 1 -1 } vector-to-center ] unit-test
+{ { 0 1 0 } } [ test-segment-oint { 0 -1 -1 } vector-to-center ] unit-test
 
 : simplest-straight-ahead ( -- oint segment )
     { 0 0 0 } { 0 0 -1 } { 0 1 0 } { -1 0 0 } <oint>
index 96992c3b8cd82d88fb731d3a81151d364fa91aaa..f9b353b85f278f4a62c384e696d8cb38eef470fe 100644 (file)
@@ -86,14 +86,14 @@ CONSTANT: default-segment-radius 1
     next current half-way-between-oints :> h
     cf h vdot cf location vdot - cf heading vdot / ;
 
-: vector-to-centre ( seg loc -- v )
+: vector-to-center ( seg loc -- v )
     over location>> swap v- swap forward>> proj-perp ;
 
-: distance-from-centre ( seg loc -- distance )
-    vector-to-centre norm ;
+: distance-from-center ( seg loc -- distance )
+    vector-to-center norm ;
 
 : wall-normal ( seg oint -- n )
-    location>> vector-to-centre normalize ;
+    location>> vector-to-center normalize ;
 
 CONSTANT: distant 1000
 
index 8ffbe5de3652ae361050419f53bd407690b338c6..02a868641136cc8f7e7ced63800341e5463ce16d 100644 (file)
@@ -17,7 +17,7 @@ SYMBOL: visited
     [ v+ ] with map
     [ unvisited? ] filter ;
 
-: random-neighbour ( cell -- newcell ) choices random ;
+: random-neighbor ( cell -- newcell ) choices random ;
 
 : vertex ( pair -- )
     first2 [ 0.5 + line-width * ] bi@ glVertex2d ;
@@ -29,7 +29,7 @@ SYMBOL: visited
     GL_LINE_STRIP glBegin
     dup vertex
     dup visit
-    dup random-neighbour [
+    dup random-neighbor [
         (draw-maze) (draw-maze)
     ] [
         drop
index e94a223ea7da7a33a0e31992c41ff7d87fa61284..8d8b1c07980aeb86ccf21b30e81f86dde20ccb31 100644 (file)
@@ -7,7 +7,7 @@ IN: path-finding
 
 HELP: astar
 { $description "This tuple must be subclassed and its method " { $link cost } ", "
-  { $link heuristic } ", and " { $link neighbours } " must be implemented. "
+  { $link heuristic } ", and " { $link neighbors } " must be implemented. "
   "Alternatively, the " { $link <astar> } " word can be used to build a non-specialized version." } ;
 
 HELP: cost
@@ -18,7 +18,7 @@ HELP: cost
   { "n" number }
 }
 { $description "Return the cost to go from " { $snippet "from" } " to " { $snippet "to" } ". "
-  { $snippet "to" } " is necessarily a neighbour of " { $snippet "from" } "."
+  { $snippet "to" } " is necessarily a neighbor of " { $snippet "from" } "."
 } ;
 
 HELP: heuristic
@@ -29,10 +29,10 @@ HELP: heuristic
   { "n" number }
 }
 { $description "Return the estimated (undervalued) cost to go from " { $snippet "from" } " to " { $snippet "to" } ". "
-  { $snippet "from" } " and " { $snippet "to" } " are not necessarily neighbours."
+  { $snippet "from" } " and " { $snippet "to" } " are not necessarily neighbors."
 } ;
 
-HELP: neighbours
+HELP: neighbors
 { $values
   { "node" "a node" }
   { "astar" "an instance of a subclassed " { $link astar } " tuple" }
@@ -42,25 +42,25 @@ HELP: neighbours
 
 HELP: <astar>
 { $values
-  { "neighbours" { $quotation ( node -- seq ) } }
+  { "neighbors" { $quotation ( node -- seq ) } }
   { "cost" { $quotation ( from to -- cost ) } }
   { "heuristic" { $quotation ( pos target -- cost ) } }
   { "astar" astar }
 }
 { $description "Build an astar object from the given quotations. The "
-  { $snippet "neighbours" } " one builds the list of neighbours. The "
+  { $snippet "neighbors" } " one builds the list of neighbours. The "
   { $snippet "cost" } " and " { $snippet "heuristic" } " ones represent "
-  "respectively the cost for transitioning from a node to one of its neighbour, "
+  "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 "
   "may not be as efficient as subclassing the " { $link astar } " tuple."
 } ;
 
 HELP: <bfs>
 { $values
-  { "neighbours" assoc }
+  { "neighbors" assoc }
   { "astar" astar }
 }
-{ $description "Build an astar object from the " { $snippet "neighbours" } " assoc. "
+{ $description "Build an astar object from the " { $snippet "neighbors" } " assoc. "
   "When used with " { $link find-path } ", this astar tuple will use the breadth-first search (BFS) "
   "path finding algorithm which is a particular case of the general A* algorithm."
 } ;
@@ -100,7 +100,7 @@ HELP: considered
 
 ARTICLE: "path-finding" "Path finding using the A* algorithm"
 "The " { $vocab-link "path-finding" } " vocabulary implements a graph search algorithm for finding the least-cost path from one node to another using the A* algorithm." $nl
-"The " { $link astar } " tuple may be derived from and its " { $link cost } ", " { $link heuristic } ", and " { $link neighbours } " methods overwritten, or the " { $link <astar> } " or " { $link <bfs> } " words can be used to build a new tuple." $nl
+"The " { $link astar } " tuple may be derived from and its " { $link cost } ", " { $link heuristic } ", and " { $link neighbors } " methods overwritten, or the " { $link <astar> } " or " { $link <bfs> } " words can be used to build a new tuple." $nl
 "Make an A* object:"
 { $subsections <astar> <bfs> }
 "Find a path between nodes:"
index 3bdf77ca284947d1ba4c8bd1fdbc9b4f81b705d3..e5466d0326aa25c9c4fa055aed0894334b85783c 100644 (file)
@@ -30,7 +30,7 @@ TUPLE: maze < astar ;
   8  X X X X X X X X X X"
         split-lines ] nth nth CHAR: X = not ;
 
-M: maze neighbours
+M: maze neighbors
     drop
     first2
     { [ 1 + 2array ] [ 1 - 2array ] [ [ 1 + ] dip 2array ] [ [ 1 - ] dip 2array ] } 2cleave
@@ -99,7 +99,7 @@ M: maze cost
 
 MEMO: routes ( -- hash ) $[ { "ABD" "BC" "C" "DCE" "ECF" } [ unclip swap 2array ] map >hashtable ] ;
 
-: n ( pos -- neighbours )
+: n ( pos -- neighbors )
     routes at ;
 
 : c ( from to -- cost )
index 7f621ef5f4e37ad950d56e8121b5e326fb2fba4e..e5048da6f762da854511532352c85be78ad775b8 100644 (file)
@@ -8,7 +8,7 @@ IN: path-finding
 TUPLE: astar g in-closed-set ;
 GENERIC: cost ( from to astar -- n )
 GENERIC: heuristic ( from to astar -- n )
-GENERIC: neighbours ( node astar -- seq )
+GENERIC: neighbors ( node astar -- seq )
 
 <PRIVATE
 
@@ -46,7 +46,7 @@ TUPLE: (astar) astar goal origin in-open-set open-set ;
     [ over ] [ over [ [ origin>> at ] keep ] dip ] produce 2nip reverse ;
 
 : handle ( node astar -- )
-    dupd [ astar>> neighbours ] keep [ ?set-g ] curry with each ;
+    dupd [ astar>> neighbors ] keep [ ?set-g ] curry with each ;
 
 : (find-path) ( astar -- path/f )
     dup open-set>> heap-empty? [
@@ -64,34 +64,34 @@ TUPLE: (astar) astar goal origin in-open-set open-set ;
     <min-heap> >>open-set
     [ 0 ] 2dip [ (add-to-open-set) ] [ astar>> g>> set-at ] 3bi ;
 
-TUPLE: astar-simple < astar cost heuristic neighbours ;
+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 neighbours neighbours>> call( n -- neighbours ) ;
+M: astar-simple neighbors neighbours>> call( n -- neighbours ) ;
 
-TUPLE: bfs < astar neighbours ;
+TUPLE: bfs < astar neighbors ;
 M: bfs cost 3drop 1 ;
 M: bfs heuristic 3drop 0 ;
-M: bfs neighbours neighbours>> at ;
+M: bfs neighbors neighbours>> at ;
 
 TUPLE: dijkstra < astar costs ;
 M: dijkstra cost costs>> swapd at at ;
 M: dijkstra heuristic 3drop 0 ;
-M: dijkstra neighbours costs>> at keys ;
+M: dijkstra neighbors costs>> at keys ;
 
 PRIVATE>
 
 : find-path ( start target astar -- path/f )
     (astar) new [ astar<< ] keep [ (init) ] [ (find-path) ] bi ;
 
-: <astar> ( neighbours cost heuristic -- astar )
-    astar-simple new swap >>heuristic swap >>cost swap >>neighbours ;
+: <astar> ( neighbors cost heuristic -- astar )
+    astar-simple new swap >>heuristic swap >>cost swap >>neighbors ;
 
 : considered ( astar -- considered )
     in-closed-set>> members ;
 
-: <bfs> ( neighbours -- astar )
-    [ bfs new ] dip >>neighbours ;
+: <bfs> ( neighbors -- astar )
+    [ bfs new ] dip >>neighbors ;
 
 : <dijkstra> ( costs -- astar )
     [ dijkstra new ] dip >>costs ;
index 5b1a639ad3edd393e2014cdac62a31d66e72a876..d0366c1ed398b584d5e7f9029dd42b5f738e537d 100644 (file)
@@ -95,7 +95,7 @@ os unix? [ [ 10 ] [ PCRE_CONFIG_NEWLINE pcre-config ] unit-test ] when
 ! Performance
 { 0 } [ long-string ".{0,15}foobar.{0,10}" findall length ] unit-test
 
-! Empty matches, corner case behaviour is copied from pcredemo.c
+! Empty matches, corner case behavior is copied from pcredemo.c
 { { { { f "foo" } } { { f "" } } } }
 [ "foo" ".*" findall ] unit-test
 
index e55fb1c668f3a42b56b587b23009854d03003366..90dd8e7bb9d5fc96eb27033d0fa87e45cb61fa03 100644 (file)
@@ -14,7 +14,7 @@ IN: project-euler.039
 
 !     {20,48,52}, {24,45,51}, {30,40,50}
 
-! For which value of p < 1000, is the number of solutions maximised?
+! For which value of p < 1000, is the number of solutions maximized?
 
 
 ! SOLUTION
index 09f10986552b3bdb5e7a241d92a9e1533a1819b7..07e45fff3d50c69fb93e49af624bca19a6112801 100644 (file)
@@ -29,7 +29,7 @@ IN: project-euler.070
 ! --------
 
 ! For n/φ(n) to be minimised, φ(n) must be as close to n as possible; that is,
-! we want to maximise φ(n). The minimal solution for n/φ(n) would be if n was
+! we want to maximize φ(n). The minimal solution for n/φ(n) would be if n was
 ! prime giving n/(n-1) but since n-1 never is a permutation of n it cannot be
 ! prime.
 
index dd71ed62b1da73aa1efc9daaaa3baedbc49f45ba..0ea04961819bb8984777de0b6f3467f39a43498d 100644 (file)
@@ -7,7 +7,7 @@ IN: project-euler.100
 
 ! DESCRIPTION ! -----------
 
-! If a box contains twenty-one coloured discs, composed of fifteen blue discs
+! If a box contains twenty-one colored discs, composed of fifteen blue discs
 !  and six red discs, and two discs were taken at random, it can be seen that
 !  the probability of taking two blue discs, P(BB) = (15/21)*(14/20) = 1/2.
 
index d2e5249bac7b5e4ce08a8e978b625dc3a6b62bf1..a7af001f30630b1d9880014849a8e2e0fbcd3322 100644 (file)
@@ -9,18 +9,18 @@ IN: project-euler.116
 ! -----------
 
 ! A row of five black square tiles is to have a number of its tiles replaced
-! with coloured oblong tiles chosen from red (length two), green (length
+! with colored oblong tiles chosen from red (length two), green (length
 ! three), or blue (length four).
 
 ! If red tiles are chosen there are exactly seven ways this can be done.
 ! If green tiles are chosen there are three ways.
 ! And if blue tiles are chosen there are two ways.
 
-! Assuming that colours cannot be mixed there are 7 + 3 + 2 = 12 ways of
+! Assuming that colors cannot be mixed there are 7 + 3 + 2 = 12 ways of
 ! 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 colours cannot be mixed and at least one coloured tile
+! length be replaced if colors cannot be mixed and at least one coloured tile
 ! must be used?
 
 
index 6b20511d607a5f4e72108a5149be6d028199da22..45777ae56aba66981401d0657a19f67953f320d6 100644 (file)
@@ -9,7 +9,7 @@ IN: project-euler.151
 ! -----------
 
 ! A printing shop runs 16 batches (jobs) every week and each batch requires a
-! sheet of special colour-proofing paper of size A5.
+! sheet of special color-proofing paper of size A5.
 
 ! Every Monday morning, the foreman opens a new envelope, containing a large
 ! sheet of the special paper with size A1.
index 69f9a024b808a6d450cc5274dd82d823b0d6d991..ef49101fb2a3f929a09e4f8d120b820eb2a276bf 100644 (file)
@@ -10,7 +10,7 @@ IN: project-euler.190
 
 ! Let Sm = (x1, x2, ... , xm) be the m-tuple of positive real numbers
 ! with x1 + x2 + ... + xm = m for which Pm = x1 * x22 * ... * xmm is
-! maximised.
+! maximized.
 
 ! For example, it can be verified that [P10] = 4112 ([ ] is the integer
 ! part function).
index 49f816c18b6b2d6525d274c27ab7abd68a1f57ad..fe339568ad54c539bd3a776557eacb343badb612 100644 (file)
@@ -754,7 +754,7 @@ FUNCTION-ALIAS: get-clipboard-text c-string GetClipboardText ( )
 ! Custom frame control functions
 ! NOTE: Those functions are intended for advance users that want full control over the frame processing
 ! By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents()
-! To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL
+! To avoid that behavior and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL
 FUNCTION-ALIAS: swap-screen-buffer void SwapScreenBuffer ( )                             ! Swap back buffer with front buffer (screen drawing)
 FUNCTION-ALIAS: poll-input-events void PollInputEvents ( )                               ! Register all input events
 FUNCTION-ALIAS: wait-time void WaitTime ( float ms )                                     ! Wait for some milliseconds (halt program execution)
index 24d19a44fd18e5b8c7ffa057b0507808f7709879..77f4830e0aec3268be007c5d15270690d80aac08 100644 (file)
@@ -20,12 +20,12 @@ IN: rosetta-code.knapsack-unbounded
 ! He can only take whole units of any item, but there is much
 ! more of any item than he could ever carry
 
-! How many of each item does he take to maximise the value of
+! How many of each item does he take to maximize the value of
 ! items he is carrying away with him?
 
 ! Note:
 
-! There are four solutions that maximise the value taken. Only
+! There are four solutions that maximize the value taken. Only
 ! one need be given.
 
 CONSTANT: values { 3000 1800 2500 }
index ec13ff186b1c0f4df46657748e46abb6703f3237..83417eae3f5280fe1d5818241c971c7639a99f21 100644 (file)
@@ -24,7 +24,7 @@ IN: rosetta-code.knapsack
 
 ! Which items does the tourist carry in his knapsack so that
 ! their total weight does not exceed 400 dag [4 kg], and their
-! total value is maximised?
+! total value is maximized?
 
 TUPLE: item
     name weight value ;
index 2384dbaedd87fd63df2f3b2fb6b157d62267d00c..7116597377e3b24eddf911fd2fdc4687b5c91f3f 100644 (file)
@@ -6,7 +6,7 @@ IN: rosetta-code.multiplication-tables
 ! http://rosettacode.org/wiki/Multiplication_tables
 
 ! Produce a formatted 12×12 multiplication table of the kind
-! memorised by rote when in primary school.
+! memorized by rote when in primary school.
 
 ! Only print the top half triangle of products.
 
index 56567f4ba23d9a15f3206fb1f590ff6d7a2e9a61..8476073daa5d56407e1e16a3ed12c2946adcb85c 100644 (file)
@@ -11,35 +11,35 @@ IN: rosetta-code.one-d-cellular
 
 ! Cells in the next generation of the array are calculated based
 ! on the value of the cell and its left and right nearest
-! neighbours in the current generation. If, in the following
+! neighbors in the current generation. If, in the following
 ! table, a live cell is represented by 1 and a dead cell by 0 then
 ! to generate the value of the cell at a particular index in the
 ! array of cellular values you use the following table:
 
 ! 000 -> 0  #
 ! 001 -> 0  #
-! 010 -> 0  # Dies without enough neighbours
-! 011 -> 1  # Needs one neighbour to survive
+! 010 -> 0  # Dies without enough neighbors
+! 011 -> 1  # Needs one neighbor to survive
 ! 100 -> 0  #
-! 101 -> 1  # Two neighbours giving birth
-! 110 -> 1  # Needs one neighbour to survive
+! 101 -> 1  # Two neighbors giving birth
+! 110 -> 1  # Needs one neighbor to survive
 ! 111 -> 0  # Starved to death.
 
 : bool-sum ( bool1 bool2 -- sum )
     [ [ 2 ] [ 1 ] if ]
     [ [ 1 ] [ 0 ] if ] if ;
 
-:: neighbours ( index world -- # )
+:: neighbors ( index world -- # )
     index [ 1 - ] [ 1 + ] bi [ world ?nth ] bi@ bool-sum ;
 
-: count-neighbours ( world -- neighbours )
-    [ length <iota> ] keep [ neighbours ] curry map ;
+: count-neighbors ( world -- neighbours )
+    [ length <iota> ] keep [ neighbors ] curry map ;
 
-: life-law ( alive? neighbours -- alive? )
+: life-law ( alive? neighbors -- alive? )
     swap [ 1 = ] [ 2 = ] if ;
 
 : step ( world -- world' )
-    dup count-neighbours [ life-law ] ?{ } 2map-as ;
+    dup count-neighbors [ life-law ] ?{ } 2map-as ;
 
 : print-cellular ( world -- )
     [ CHAR: # CHAR: _ ? ] "" map-as print ;
index 9acb53d8b36b143165f4fe14cf276bce99986aa8..2ca3ba8a0bff0ae99639a16609cef23f905761b2 100644 (file)
@@ -22,9 +22,9 @@ TUPLE: board
 : board@block ( board block -- n row )
     [ second swap rows>> nth ] keep first swap ;
 
-: set-block ( board block colour -- ) -rot board@block set-nth ;
+: set-block ( board block color -- ) -rot board@block set-nth ;
 
-: block ( board block -- colour ) board@block nth ;
+: block ( board block -- color ) board@block nth ;
 
 : block-free? ( board block -- ? ) block not ;
 
index b6e2539bcab0596babd53b4086f1224bb040c314..ac5dbc2579ea3f31944b460ada4e38aae2d21d7c 100644 (file)
@@ -42,7 +42,7 @@ CONSTANT: default-height 20
     level 1 - 60 * 1,000,000,000 swap - ;
 
 : add-block ( tetris block -- )
-    over [ board>> ] 2dip current-piece tetromino>> colour>> set-block ;
+    over [ board>> ] 2dip current-piece tetromino>> color>> set-block ;
 
 : game-over? ( tetris -- ? )
     [ board>> ] [ next-piece ] bi piece-valid? not ;
index f8f6a5a9454793443b9fdf95f45429607932ceb1..e0565c8aa01702d79d58da4dc31b8d49c5bd941e 100644 (file)
@@ -15,10 +15,10 @@ IN: tetris.gl
     piece-blocks [ draw-block ] each ;
 
 : draw-piece ( piece -- )
-    dup tetromino>> colour>> gl-color draw-piece-blocks ;
+    dup tetromino>> color>> gl-color draw-piece-blocks ;
 
 : draw-next-piece ( piece -- )
-    dup tetromino>> colour>>
+    dup tetromino>> color>>
     >rgba-components drop 0.2 <rgba> gl-color draw-piece-blocks ;
 
 ! TODO: move implementation specific stuff into tetris-board
index 9b38eb29636086dd22ae10f3c0213812b1ad5075..8ef06eb173cd74d91091c64c3fbcfe20f591e86c 100644 (file)
@@ -5,7 +5,7 @@ USING: colors math namespaces random sequences ;
 
 IN: tetris.tetromino
 
-TUPLE: tetromino states colour ;
+TUPLE: tetromino states color ;
 
 C: <tetromino> tetromino