From 6d4293b5822d769619f66e46e64b704ddfe41b43 Mon Sep 17 00:00:00 2001 From: Giftpflanze Date: Tue, 23 Aug 2022 17:36:55 +0200 Subject: [PATCH] Harmonize spelling --- basis/promises/promises-docs.factor | 2 +- extra/boids/boids.factor | 10 ++--- extra/boids/simulation/simulation.factor | 38 +++++++++---------- extra/jamshred/player/player.factor | 8 ++-- extra/jamshred/tunnel/tunnel-tests.factor | 16 ++++---- extra/jamshred/tunnel/tunnel.factor | 8 ++-- extra/maze/maze.factor | 4 +- extra/path-finding/path-finding-docs.factor | 20 +++++----- extra/path-finding/path-finding-tests.factor | 4 +- extra/path-finding/path-finding.factor | 22 +++++------ extra/pcre/pcre-tests.factor | 2 +- extra/project-euler/039/039.factor | 2 +- extra/project-euler/070/070.factor | 2 +- extra/project-euler/100/100.factor | 2 +- extra/project-euler/116/116.factor | 6 +-- extra/project-euler/151/151.factor | 2 +- extra/project-euler/190/190.factor | 2 +- extra/raylib/raylib.factor | 2 +- .../knapsack-unbounded.factor | 4 +- extra/rosetta-code/knapsack/knapsack.factor | 2 +- .../multiplication-tables.factor | 2 +- .../one-d-cellular/one-d-cellular.factor | 20 +++++----- extra/tetris/board/board.factor | 4 +- extra/tetris/game/game.factor | 2 +- extra/tetris/gl/gl.factor | 4 +- extra/tetris/tetromino/tetromino.factor | 2 +- 26 files changed, 96 insertions(+), 96 deletions(-) diff --git a/basis/promises/promises-docs.factor b/basis/promises/promises-docs.factor index 9c26923114..db45ca339c 100644 --- a/basis/promises/promises-docs.factor +++ b/basis/promises/promises-docs.factor @@ -5,7 +5,7 @@ IN: promises HELP: { $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" } } diff --git a/extra/boids/boids.factor b/extra/boids/boids.factor index 42190abd22..7ca546fba5 100644 --- a/extra/boids/boids.factor +++ b/extra/boids/boids.factor @@ -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 1.0 40 -0.5 1.0 25 -1.0 @@ -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 } add-gadget ; diff --git a/extra/boids/simulation/simulation.factor b/extra/boids/simulation/simulation.factor index b2df09f8c0..1310d2ddc6 100644 --- a/extra/boids/simulation/simulation.factor +++ b/extra/boids/simulation/simulation.factor @@ -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 : 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 ) ] replicate ; -TUPLE: cohesion < behaviour ; -TUPLE: alignment < behaviour ; -TUPLE: separation < behaviour ; +TUPLE: cohesion < behavior ; +TUPLE: alignment < behavior ; +TUPLE: separation < behavior ; C: cohesion C: alignment C: 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 ; diff --git a/extra/jamshred/player/player.factor b/extra/jamshred/player/player.factor index f75198e1ba..1c691bcb70 100644 --- a/extra/jamshred/player/player.factor +++ b/extra/jamshred/player/player.factor @@ -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 <= [ diff --git a/extra/jamshred/tunnel/tunnel-tests.factor b/extra/jamshred/tunnel/tunnel-tests.factor index 4a215d0684..4f536fb330 100644 --- a/extra/jamshred/tunnel/tunnel-tests.factor +++ b/extra/jamshred/tunnel/tunnel-tests.factor @@ -9,14 +9,14 @@ IN: jamshred.tunnel.tests : test-segment-oint ( -- oint ) { 0 0 0 } { 0 0 -1 } { 0 1 0 } { -1 0 0 } ; -{ { -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 } diff --git a/extra/jamshred/tunnel/tunnel.factor b/extra/jamshred/tunnel/tunnel.factor index 96992c3b8c..f9b353b85f 100644 --- a/extra/jamshred/tunnel/tunnel.factor +++ b/extra/jamshred/tunnel/tunnel.factor @@ -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 diff --git a/extra/maze/maze.factor b/extra/maze/maze.factor index 8ffbe5de36..02a8686411 100644 --- a/extra/maze/maze.factor +++ b/extra/maze/maze.factor @@ -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 diff --git a/extra/path-finding/path-finding-docs.factor b/extra/path-finding/path-finding-docs.factor index e94a223ea7..8d8b1c0798 100644 --- a/extra/path-finding/path-finding-docs.factor +++ b/extra/path-finding/path-finding-docs.factor @@ -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 } " 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: { $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: { $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 } " or " { $link } " 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 } " or " { $link } " words can be used to build a new tuple." $nl "Make an A* object:" { $subsections } "Find a path between nodes:" diff --git a/extra/path-finding/path-finding-tests.factor b/extra/path-finding/path-finding-tests.factor index 3bdf77ca28..e5466d0326 100644 --- a/extra/path-finding/path-finding-tests.factor +++ b/extra/path-finding/path-finding-tests.factor @@ -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 ) diff --git a/extra/path-finding/path-finding.factor b/extra/path-finding/path-finding.factor index 7f621ef5f4..e5048da6f7 100644 --- a/extra/path-finding/path-finding.factor +++ b/extra/path-finding/path-finding.factor @@ -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 ) > 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 ; >>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 ; -: ( neighbours cost heuristic -- astar ) - astar-simple new swap >>heuristic swap >>cost swap >>neighbours ; +: ( neighbors cost heuristic -- astar ) + astar-simple new swap >>heuristic swap >>cost swap >>neighbors ; : considered ( astar -- considered ) in-closed-set>> members ; -: ( neighbours -- astar ) - [ bfs new ] dip >>neighbours ; +: ( neighbors -- astar ) + [ bfs new ] dip >>neighbors ; : ( costs -- astar ) [ dijkstra new ] dip >>costs ; diff --git a/extra/pcre/pcre-tests.factor b/extra/pcre/pcre-tests.factor index 5b1a639ad3..d0366c1ed3 100644 --- a/extra/pcre/pcre-tests.factor +++ b/extra/pcre/pcre-tests.factor @@ -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 diff --git a/extra/project-euler/039/039.factor b/extra/project-euler/039/039.factor index e55fb1c668..90dd8e7bb9 100644 --- a/extra/project-euler/039/039.factor +++ b/extra/project-euler/039/039.factor @@ -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 diff --git a/extra/project-euler/070/070.factor b/extra/project-euler/070/070.factor index 09f1098655..07e45fff3d 100644 --- a/extra/project-euler/070/070.factor +++ b/extra/project-euler/070/070.factor @@ -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. diff --git a/extra/project-euler/100/100.factor b/extra/project-euler/100/100.factor index dd71ed62b1..0ea0496181 100644 --- a/extra/project-euler/100/100.factor +++ b/extra/project-euler/100/100.factor @@ -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. diff --git a/extra/project-euler/116/116.factor b/extra/project-euler/116/116.factor index d2e5249bac..a7af001f30 100644 --- a/extra/project-euler/116/116.factor +++ b/extra/project-euler/116/116.factor @@ -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? diff --git a/extra/project-euler/151/151.factor b/extra/project-euler/151/151.factor index 6b20511d60..45777ae56a 100644 --- a/extra/project-euler/151/151.factor +++ b/extra/project-euler/151/151.factor @@ -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. diff --git a/extra/project-euler/190/190.factor b/extra/project-euler/190/190.factor index 69f9a024b8..ef49101fb2 100644 --- a/extra/project-euler/190/190.factor +++ b/extra/project-euler/190/190.factor @@ -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). diff --git a/extra/raylib/raylib.factor b/extra/raylib/raylib.factor index 49f816c18b..fe339568ad 100644 --- a/extra/raylib/raylib.factor +++ b/extra/raylib/raylib.factor @@ -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) diff --git a/extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor b/extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor index 24d19a44fd..77f4830e0a 100644 --- a/extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor +++ b/extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor @@ -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 } diff --git a/extra/rosetta-code/knapsack/knapsack.factor b/extra/rosetta-code/knapsack/knapsack.factor index ec13ff186b..83417eae3f 100644 --- a/extra/rosetta-code/knapsack/knapsack.factor +++ b/extra/rosetta-code/knapsack/knapsack.factor @@ -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 ; diff --git a/extra/rosetta-code/multiplication-tables/multiplication-tables.factor b/extra/rosetta-code/multiplication-tables/multiplication-tables.factor index 2384dbaedd..7116597377 100644 --- a/extra/rosetta-code/multiplication-tables/multiplication-tables.factor +++ b/extra/rosetta-code/multiplication-tables/multiplication-tables.factor @@ -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. diff --git a/extra/rosetta-code/one-d-cellular/one-d-cellular.factor b/extra/rosetta-code/one-d-cellular/one-d-cellular.factor index 56567f4ba2..8476073daa 100644 --- a/extra/rosetta-code/one-d-cellular/one-d-cellular.factor +++ b/extra/rosetta-code/one-d-cellular/one-d-cellular.factor @@ -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 ] keep [ neighbours ] curry map ; +: count-neighbors ( world -- neighbours ) + [ length ] 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 ; diff --git a/extra/tetris/board/board.factor b/extra/tetris/board/board.factor index 9acb53d8b3..2ca3ba8a0b 100644 --- a/extra/tetris/board/board.factor +++ b/extra/tetris/board/board.factor @@ -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 ; diff --git a/extra/tetris/game/game.factor b/extra/tetris/game/game.factor index b6e2539bca..ac5dbc2579 100644 --- a/extra/tetris/game/game.factor +++ b/extra/tetris/game/game.factor @@ -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 ; diff --git a/extra/tetris/gl/gl.factor b/extra/tetris/gl/gl.factor index f8f6a5a945..e0565c8aa0 100644 --- a/extra/tetris/gl/gl.factor +++ b/extra/tetris/gl/gl.factor @@ -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 gl-color draw-piece-blocks ; ! TODO: move implementation specific stuff into tetris-board diff --git a/extra/tetris/tetromino/tetromino.factor b/extra/tetris/tetromino/tetromino.factor index 9b38eb2963..8ef06eb173 100644 --- a/extra/tetris/tetromino/tetromino.factor +++ b/extra/tetris/tetromino/tetromino.factor @@ -5,7 +5,7 @@ USING: colors math namespaces random sequences ; IN: tetris.tetromino -TUPLE: tetromino states colour ; +TUPLE: tetromino states color ; C: tetromino -- 2.34.1