Not logged in
Overview
SHA1 Hash:6136ede88dfdb6995b8626e4366d168a0145b598
Date: 2011-12-06 19:04:26
User: crc
Comment:more use of variables| instead of elements
Timelines: family | ancestors | descendants | both | trunk
Other Links: files | manifest
Tags And Properties
Changes
[hide diffs]    [patch]

Modified games/hangman/hangman.retro from [445abd42a07a88af] to [7fdd92de2155a582].

@@ -14,11 +14,11 @@
 include graphics.retro
 include dict.retro
 
 ( --[ Variables ]--------------------------------------------- )
 
-5 elements target guessed lifeline this-char foul-count
+variables| target guessed lifeline this-char foul-count |
 stages constant lives                     ( see graphics.retro )
 create foul-addr lives allot
 
 ( --[ Offset Calculation ]------------------------------------ )
 

Modified games/tic-tac-toe.rx from [f7609f4e5392d0dc] to [94705a58da6c33dc].

@@ -1,8 +1,8 @@
 with canvas'
 
-3 elements mx my color
+variables| mx my color |
 
 : toggle dup @ not swap ! ;
 : player @color [ red ] [ blue ] if color toggle ;
 
 : drawBoard  ( - )

Modified misc/bmi.rx from [1d235524cf4410c9] to [5e7d029252720ba6].

@@ -1,16 +1,25 @@
 ( Body Mass Index Calculator   )
 ( Ported from Ron Aaron's Reva )
 
-2 elements height weight
+variables| height weight |
+
 : hello  "\nBMI calculator 1.0\n" puts ;
+
+: ask  ( $-n )
+  "\nPlease enter your %s: " puts getToken toNumber ;
+
 : getHeight
-  "\nPlease enter your height, in centimeters: " puts getToken toNumber !height ;
+  "height, in centimeters" ask !height ;
+
 : getWeight
-  "\nPlease enter your weight in kilograms: "    puts getToken toNumber !weight ;
+  "weight in kilograms"    ask !weight ;
+
 : showBMI
   @weight 100000 @height dup * &* dip / 10 /mod
   @height @weight
   "\nFor a weight of %d kg, and a height of %d cm, the BMI is %d.%d\n" puts ;
+
 : getBMI hello getHeight getWeight showBMI bye ;
+
 getBMI
 

Modified util/extract-doc.rx from [001b49e7485aa0bc] to [300200f52417c763].

@@ -1,6 +1,6 @@
-2 elements in out
+variables| in out |
 
 : seekDocBlock ( - )
   [ @in ^files'readLine "doc{" compare not ] while ;
 
 : extractDocBlock ( - )

Modified util/grep.rx from [db1b29ce45dcb574] to [8a9ec12a24116a70].

@@ -1,10 +1,10 @@
 ( "filename"  "substring" grep )
 ( display all lines containing "substring" in "filename" )
 
 {{
-  2 elements token content
+  variables| token content |
 
   : clean ( $- )
     withLength
     [ dup @ 10 13 within [ 999 swap &! sip ] ifTrue 1+ ] times drop ;
 
@@ -18,12 +18,11 @@
     here swap ^files'slurp here !content heap +! 32 , 0 ,
     @content clean ;
 
   : eachLine ( $- )
     [ getLine process dup 1 <> ] while drop ;
-
 ---reveal---
   : grep ( $$- )
     cr keepString !token
     heap [ loadSourceData @content eachLine ] preserve ;
 }}
 

Modified util/wc.rx from [a433321878465eba] to [ceea8442bb7f34a7].

@@ -1,7 +1,7 @@
 {{
-  3 elements content lines words
+  variables| content lines words |
 
   : clean ( $- )
     withLength
     [ dup @ 10 13 within [ 999 swap &! sip ] ifTrue 1+ ] times drop ;