REBOL[ Title: "Race" Date: 08-Nov-2005 File: %Race.r Author: "Tim Wylie" Purpose: "Very basic console racing game based off old apple one" ] End: func["End function" line [integer!]"Line number reached"][ print rejoin["You reached line " line] halt ] TrackL:"***************" TrackR:"***************" Road: " " V: 8 line_num: 0 wait_time: to-time .3 skill_time: to-time 00:00:10 console-port: open/binary [scheme: 'console] random/seed now current_time: now/time forever [ line_num: line_num + 1 if (now/time - current_time) > skill_time[ if sindex: find Road " "[ remove sindex insert TrackR "*"] if wait_time > to-time .06 [wait_time: wait_time - .05] current_time: now/time random/seed now ] shift: random 2 if (length? TrackL) > 2[ if shift <= 1 [ remove TrackL insert TrackR "*" V: V + 1] if shift <= .5 [ remove TrackL insert TrackR "*" V: V + 1] ] if (length? TrackR) > 2[ if shift > 1 [ remove TrackR insert TrackL "*" V: V - 1] if shift >= 1.5 [ remove TrackR insert TrackL "*" V: V - 1] ] if vindex: find Road "V"[remove vindex] Track: head (insert (skip Road V) 'V) print rejoin[TrackL Road TrackR];Track if V < 0 [End line_num] if V > (length? Road)[End line_num] val: wait reduce [.0001 console-port] if val <> none [ char: to-char last console-port switch char[ #"a" [V: V - 1] #"d" [V: V + 1] #"q" [End line_num] ] ] wait wait_time ]