home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
trucker.zip
/
TRUCKER.CMD
< prev
Wrap
OS/2 REXX Batch file
|
1994-10-14
|
54KB
|
1,772 lines
/* REXX */
/*
========================================================================
------------------------------- TRUCKER --------------------------------
TRUCKER in REXX
A Multi-platform And Execute-ready Game Program
Version: 10/14/94
--------------------------- F R E E W A R E ----------------------------
========================================================================
This was originally a BASIC program written by Hughes Glantzberg from
Irving, Texas.
This version has been created based on the above program by Simon Husin
to show REXX program's flexibility and portability.
TRUCKER in REXX has been tested to run problem-free on MVS/TSO, Unix,
VM/CMS, OS/2, DOS, DOS/Windows, Amiga, and OS/400 platforms. For
compatibility & other info, please see notes at the bottom the program.
Following the Main Program, the functions are placed in the order of
their names.
Update History:
========================================================================
March, 1993 Version
------------------------------------------------------------------------
- Program released and transmitted to BBSes in
USA
Holland
Belgium
September, 1994 Version
------------------------------------------------------------------------
- OS/400 Support
- Fill, Fill up, Fillup, or Full for Gas quantity is now allowed
- 'shbracket' field introduced to make it more problem-free to upload
and download this program between PC and the Host.
(IBM mainframes do not support 'rectangle' brackets, so they get
converted either to spaces or other values)
- REXX General Information has been removed from Notes and placed in
REXXIsIt.DOC which accompanies this program.
- Program transmitted to BBSes in
Australia, Melbourne
Belgium, Antwerp (multiple BBSes)
USA, California
Chicago
Missouri
Virginia
Washington (multiple BBSes)
October, 1994 Version
------------------------------------------------------------------------
- Function RND simplified
- OS/400 Support corrected
- REXX/370 Compiler release 2.0 compilation results reported
- Tritus ISPF 1.2.5 REXX now runs 'stripped-down' version of Trucker
========================================================================
*/
/*
------------------------------------------------------------------------
Main Program
------------------------------------------------------------------------
*/
/* Start Main Program Initialization */
call time 'R' /* Reset the elapse time for the entire program */
parse source shenv .
queue shenv
drop shenv
/* General Initialization */
call InitialGame
/* Main Driver */
do while sh_keep_on_trucking
call TruckTheJourney
end
/* Termination */
say ' '
say 'End Of Game...'
say 'Thank you for playing T.R.U.C.K.E.R.'
return 0
AnimateOS2Truck: procedure
/*
------------------------------------------------------------------------
Show a 'moving truck' under OS/2 2.x PL/2 REXX
------------------------------------------------------------------------
*/
sht1 = ' TRUCKER_OO=.'
sht2 = " -()-----()='"
shtx = center('Press Enter to start the game...', 79)
call syscurstate 'OFF' /* temporarily hide the cursor */
do i = 2 to 79
if i > 67 & i < 79 then do
shil = 79 - i
sht1 = left(sht1, shil)
sht2 = left(sht2, shil)
end
call syscurpos 19, i
say sht1
call syscurpos 20, i
say sht2
call syscurpos 20, 2
say left(shtx, i)
end
call syscurstate 'ON'
return 0
AnimatePersonalTruck: procedure
/*
------------------------------------------------------------------------
Show a 'moving truck' under Quercus Personal/REXX
------------------------------------------------------------------------
*/
sht1 = ' TRUCKER_OO=.'
sht2 = " -()-----()='"
shtx = center('Press Enter to start the game...', 79)
do i = 2 to 79
if i > 67 & i < 79 then do
shil = 79 - i
sht1 = left(sht1, shil)
sht2 = left(sht2, shil)
end
call cursor 20, i
say sht1
call cursor 21, i
say sht2
call cursor 21, 2
say left(shtx, i)
end
return 0
AnimatePortableTruck: procedure
/*
------------------------------------------------------------------------
Show a 'moving truck' under Kilowatt Software Portable/REXX
------------------------------------------------------------------------
*/
sht1 = ' TRUCKER_OO=.'
sht2 = " -()-----()='"
shtx = center('Press Enter to start the game...', 79)
do i = 2 to 79
if i > 67 & i < 79 then do
shil = 79 - i
sht1 = left(sht1, shil)
sht2 = left(sht2, shil)
end
call cursor 20, i
say sht1
call cursor 21, i
say sht2
call cursor 21, 2
if i < 78 then /* to avoid a line overflow, bug(?) in ver.1.10 - */
say left(shtx, i)
end
return 0
CalcSpoilFactor: procedure expose ct cx
/*
------------------------------------------------------------------------
Calculate load 1 (oranges) spoil factor
------------------------------------------------------------------------
*/
if ct = 1 then do
cx = cx + (RND() * 3) % 1
say ' Sitting with the refer unit off is damaging the oranges.'
end
call Delay 1000
return 0
ChangeFlatTire:
/*
------------------------------------------------------------------------
Change the flat tire(s)
------------------------------------------------------------------------
*/
shf = 3000
shd = 100
interpret rxbeep
do shw = 200 to 100 by - 50
shf = shw
shd = (200 / shf * 500) % 1
interpret rxbeep
shf = shw / 2
interpret rxbeep
end
say 'You just blew a tire !!'
if ts <= 0 then do
say 'Since your spare has already been used, you have to call a tow'
say 'truck'
say 'from town to deliver a new tire for you.'
say ' This service cost $400.00 and took 4 hours.'
hl = hl + 4
hr = hr + 4
xc = xc + 400
end
else do
ts = ts - 1
if ts < 0 then
ts = 0
tc = tc - 2 * ts
t = (RND() * 2) % 1 + 1
if t = 1 then
tX = 'outside'
else
tX = 'inside'
say ' It took 't' hours to change the 'tX' tire.'
hl = hl + t + 1
hr = hr + t + 1
end
call Delay 750
return 0
CheckObstacles:
/*
------------------------------------------------------------------------
Check obstacles or hindrance on the road
------------------------------------------------------------------------
*/
say 'You have just passed 'mpX.rt.np
zh = zm.rt.np
sl = 55
intzh = zh % 1
select
when intzh = 1 then do
say 'Time zone changes -- set clock ahead one hour.'
hr = hr + 1
call ReportTripDuration hr
end
when intzh = 2 then do
t = 100 * (zh - intzh) % 1
if t > 0 then do
say 'STOP! Pay toll of $'t
xc = xc + t
end
end
when intzh = 3 then do
if RND() >= zh - intzh then do
say 'Construction ahead !!'
call Delay 150
say 'Slow down -- speed limit 35 MPH'
sl = 35
end
end
when intzh = 4 then do
if RND() >= zh - intzh then do
t = sp + RND() * 5 % 1 - 2
say 'You were just clocked by radar at 't'MPH.'
if t > sl + 3 then do
call StopForPolice
if sh_keep_on_trucking then
nop
else
return 0
end
else
say ' No ticket this time.'
end
end
when intzh = 5 then do
if zh = intzh &,
RND() >= 0.5 |,
(zh < intzh | zh > intzh) &,
RND() < zh - intzh then
nop
else do
say 'Weighing station open -- trucks must stop.'
call Delay 150
say 'Scale weighs truck with cargo, fuel & driver: '
t = (19000 + wl + 7 * wf + 25 * RND() * 10) % 1
say t' pounds.'
t = t - 68000 % 1 /* limit was 60000 */
if t < 1 then
say " You're O.K."
else if zh = 5 then do
say 'You are not allowed to enter Louisiana with that',
'load.'
say ' Take a 200 mile detour through Arkansas',
'with 45 MPH limit.'
sl = 45
mrX.rt.np = 'Arkansas country roads'
do i = 12 to 25
mp.rt.i = mp.rt.i + 200
end
mt.rt = mt.rt + 200
end
else do
t1 = (RND() * 4 + 2) % 1
say ' Overweight fine is $200.00 plus 't1' cents/pound.'
xc = xc + 200 + (t * t1) / 100
say 'Pay fine of $'200 + (t * t1) / 100
end
end
end
when intzh = 6 then do
if RND() >= zh - intzh then do
t = (RND() * 6) % 1
say 'A rock slide has blocked the Alleghany Tunnel',
'entrance.'
say ' THE HIGHWAY DEPARTMENT WILL HAVE IT',
'CLEARED IN 't' HOURS.'
hr = hr + t
call Delay 150
hsw1 = 1
if ct = 1 then do
wf = wf - 7 * t
if wf <= 1 then do
say ' You ran out of gas while waiting...'
t = 0
call WaitForGasDelivery
hsw1 = 0
end
end
if hsw1 then do
if t > 1 then
t1 = (t / 2 + 0.5) % 1
else
t1 = 0
if t1 > 3 then
hl = 0
else if t1 > 0 then
hl = hl / 2
hs = hs + t1
say ' While waiting, you got 't1' hours of sleep...'
call ReportTripDuration hr
end
end
end
when intzh = 7 then do
if ct = 1 &,
RND() >= zh - intzh then do
say 'The trailer refrigeration unit has failed endangering',
'the cargo.'
say ' Repairs take 2 hours and cost $100.00.'
cx = cx + RND() * 5 % 1
hl = hl + 2
hr = hr + 2
xc = xc + 100
call ReportTripDuration hr
call Delay 400
end
end
when intzh = 8 then
call EndOfTrip
otherwise
nop
end
np = np + 1
call Delay 150
return 0
CheckOS: procedure expose rxbeep rxcls rxenv rxext rxpull
/*
------------------------------------------------------------------------
Check operating system environment
Initial system specific commands for local system interpret(ation)
------------------------------------------------------------------------
*/
parse version interpreter version release
addr = address()
parse pull env
/* parse source env . */
rxenv = env' @ 'addr' Running:'interpreter' Ver/Rel:'version'/'release
rxext = "say center('Press Enter to start the game...', 79)"
interpreter = translate(interpreter)
addr = translate(addr)
shbracket = d2c(91) /* 'Rectangle' left (open) parenthesis */
select
when interpreter = 'REXX370' then do
/* Welcome to the IBM Mainframe */
select
when addr = 'MVS' then do /* MVS */
say 'Sorry!'
say 'This program is not intended to be used in the'
say 'MVS Batch (IRXJCL) environment.'
exit 10
end
when addr = 'TSO' then do /* TSO/E */
if strip(sysvar('sysenv')) = 'FORE' then do
rxcls = "'clrscrn'"
rxbeep = 'nop'
rxpull = 'pull shstr'
end
else do
say 'Sorry!'
say 'This program is not intended to be used in the'
say 'TSO Batch (IKJEFT01) environment.'
exit 20
end
end
otherwise /* VM/CMS */
rxcls = "'clrscrn'" /* SH 03/04/93 */
rxbeep = 'nop'
rxpull = 'pull shstr'
end
end
when interpreter = 'UNI-REXX' then do
/* Welcome to a Unix/AIX Workstation */
/* The Workstation Group (wrk/grp) uni-REXX */
rxcls = "'clear'"
rxbeep = "'echo "d2c(7)"'" /* ANSI ESC seq. char. (BELL) */
rxpull = 'pull shstr'
end
when interpreter = 'REXXSAA' &,
addr = 'COMMAND' then do /* Welcome to the OS/400 REXX */
rxcls = 'say d2c(12)' /* EBCDIC char. (FF) */
rxbeep = 'say d2c(47)' /* EBCDIC char. (BEL) */
rxpull = 'pull shstr'
end
when interpreter = 'REXXSAA' &,
addr = 'CMD' then do /* Welcome to the IBM PL 2/REXX */
rxbeep = 'result = beep(shf, shd * 1.5 % 1)'
rxcls = "'cls'"
/* Escape character, bracket, 36;44m light cyan on blue */
say '1B'x || shbracket'1;36;44m'
if word(release, 3) < 1992 then do
'echo off'
rxpull = 'shstr = translate(linein(con))'
rxenv = rxenv '(16-bit)'
end
else do
'@echo off'
call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
call sysloadfuncs
rxpull = 'pull shstr'
rxenv = rxenv '(32-bit)'
rxext = 'call AnimateOS2Truck'
end
end
when interpreter = 'REXX/PERSONAL' then do
/* Welcome to the Quercus Systems REXX world */
if addr = 'CMD' then do /* under OS/2 */
/* Escape character, bracket, 36;44m light cyan on blue */
say '1B'x || shbracket'1;36;44m'
rxcls = 'result = scrwrite(1,1,,2000,,27) cursor(1,1)'
rxbeep = 'result = sound(shf, shd / 700)' /* or beep */
rxpull = 'pull shstr'
if version <= 2 then
rxenv = rxenv '(16-bit)'
else
rxenv = rxenv '(32-bit)'
rxext = 'call AnimatePersonalTruck'
end
else if addr = 'DOS' then do /* under PC/MS-DOS */
rxcls = 'result = scrwrite(1,1,,2000,,27) cursor(1,1)'
rxbeep = 'result = sound(shf, shd / 700)' /* or beep */
rxpull = 'pull shstr'
rxext = 'call AnimatePersonalTruck'
end
else if addr = 'WINREXX' then do /* under MS-Windows or
IBM WinOS2 */
rxcls = "'cls'"
rxbeep = 'result = sound(shf, shd / 700)' /* or beep */
rxpull = 'pull shstr'
end
else do /* unknown env. */
rxcls = "do 25;say ' ';end"
rxbeep = 'result = sound(shf, shd / 700)' /* assumed! */
rxpull = 'pull shstr'
end
end
when left(interpreter, 9) = 'REXX-KILO' then do /* PC/MS-DOS */
/* Welcome to the Kilowatt Software Portable/REXX */
rxcls = "'cls'"
rxbeep = 'result = tone(shf, shd / 700)'
rxpull = 'pull shstr'
rxext = 'call AnimatePortableTruck'
end
when left(interpreter, 9) = 'REXX/WIND' then do /* Windows/Win-OS2 */
/* Welcome to the Kilowatt Software REXX/Windows */
rxcls = "'cls'"
rxbeep = 'result = tone(shf, shd / 700)'
rxpull = 'pull shstr'
end
when interpreter = 'REXXSAA' &,
addr = 'ISPEXEC' then do
/* Welcome to the Tritus REXX under OS/2 TSPF */
rxcls = 'ADDRESS CMD CLS'
rxbeep = 'nop'
rxpull = 'pull shstr'
end
when interpreter = 'REXX:OPEN-REXX179' then do
/* Welcome to the Tritus REXX under DOS TSPF */
rxcls = "ADDRESS CMD CLS"
rxbeep = 'nop'
rxpull = 'pull shstr'
end
when interpreter = 'AREXX' then do
/* Welcome to the Amiga Micro Computer w/ ARexx */
/* Escape character, bracket, 2J */
rxcls = "result = writech('STDOUT', '1B'x"
rxcls = rxcls || '"' || shbracket || '2J")'
/* ANSI ESC seq. char. (CLS) */
rxbeep = "result = writech('STDOUT', '07'x)"
/* ANSI ESC seq. char. (BELL) */
rxpull = 'pull shstr'
end
otherwise
/* Welcome to ... computer environment */
rxcls = 'nop' /* with your ... REXX interpreter/compiler */
rxbeep = 'nop'
rxpull = 'pull shstr'
end
interpret rxcls
return 0
CheckPhysical:
/*
------------------------------------------------------------------------
Check the mood & physical condition of trucker
------------------------------------------------------------------------
*/
if hl > 19 |,
hr / hs > 4 then do
cd = 100
cdX = '..E.X.H.A.U.S.T.E.D..'
end
else if hl < 4 &,
Cos(hr / (hs * 1.819)) > 0 then do
cd = 1
cdX = 'rested & rearing to go.'
end
else if hl < 8 &,
Cos(hr / (hs * 1.892)) > 0 then do
cd = 2
cdX = 'fine'
end
else if hl < 12 &,
hr / hs <= 3 then do
cd = 4
cdX = ' b o r e d'
end
else if hl < 16 &,
hr / hs <= 3 then do
cd = 8
cdX = ' t i r e d !!'
end
else do
cd = 25
cdX = "fatigued...you're getting sleepy"
end
return 0
CheckWheater:
/*
------------------------------------------------------------------------
Check the weather and driving condition and report its description
------------------------------------------------------------------------
*/
af = (3000 + mf) * RND()
crX = 'clear & dry'
select
when rt = 0 then do
if af < 3400 &,
(cr < 50 | cr > 50) then
cr = 1
else if af > 4900 then do
cr = 50
crX = 'B-L-I-Z-Z-A-R-D !!'
end
else if af > 4700 then do
cr = 10
crX = 'fog -- limited visibility'
end
else if af > 4200 then do
cr = 5
if (RND() * 3) % 1 + 1 = 1 then
crX = 'light snow'
else
crX = 'rain'
end
else do
cr = 3
crX = 'clear, but roadway is wet'
end
end
when rt = 1 then do
if af < 3300 &,
(cr < 50 | cr > 50) then
cr = 1
else if af > 4800 then do
cr = 50
crX = 'B-L-I-Z-Z-A-R-D !!'
end
else if af > 4600 then do
cr = 10
crX = 'fog -- limited visibility'
end
else if af > 3800 then do
cr = 5
crX = 'light snow'
end
else do
cr = 3
crX = 'clear, but roadway is wet'
end
end
otherwise do
if af < 4000 &,
(cr < 50 | cr > 50) then
cr = 1
else if af > 5700 then do
cr = 50
crX = 'B-L-I-Z-Z-A-R-D !!'
end
else if af > 5500 then do
cr = 10
crX = 'fog -- limited visibility'
end
else if af > 4400 then do
cr = 5
crX = 'rain'
end
else do
cr = 3
crX = 'clear, but roadway is wet'
end
end
end
return 0
Cos: procedure
arg rad .
/*
------------------------------------------------------------------------
Calculate the COSine of the argument X (in Radians)
According to algorithm: cos(x) = 1 - x**2/2! + x**4/4! - x**6/6! + ...
------------------------------------------------------------------------
*/
serrad = 1
serfactn = 0
serfact = 1
plusmin = 1
radquad = rad * rad
cosine = 1
do digits()
serrad = serrad * radquad
serfactn = serfactn + 2
serfact = serfact * (serfactn - 1) * serfactn
plusmin = 0 - plusmin
serprec = serrad / serfact * plusmin
if serprec = 0 then
leave
cosine = cosine + serprec
end
return cosine
Delay: procedure
arg timeout
/*
------------------------------------------------------------------------
Delay processing through a loop for 'timeout' hundredths
------------------------------------------------------------------------
*/
if timeout < 0.5 then
return 0
call time 'R' /* Reset the elapse time for this function only */
hsec = (timeout + 0.5) / 100
do until hsec <= time('E')
end
return 0
EndOfTrip:
/*
------------------------------------------------------------------------
End of trip processing
------------------------------------------------------------------------
*/
interpret rxcls
say ' '
say center('WELCOME', 79)
call Delay 100
say center('TO', 79)
call Delay 100
say center('NEW YORK', 79)
call Delay 250
call ReportTripDuration hr
t = hr - (hr % 24)
if t < 10 &,
t > 21 then do
say 'The warehouse is closed...'
if t < 10 then
t = 10 - t
else
t = 34 - t
say 'Wait 'FormatSim(t, 3)' hours until it opens...'
call Delay 500
hr = hr + t
call ReportTripDuration hr
end
say ' '
t = (hr / 24) % 1
t1 = hr - 24 * t
if t1 > 1 then
say 'You completed the trip in 't' days and 't1' hours.'
else
say 'You completed the trip in 't' days.'
say ' Trip expenses totaled $'xc
t1 = 85 * t + 85
say ' Truck payment, insurance and taxes cost $'t1
xc = xc + t1
xt = 0
say ' '
if ct = 1 then do
t1 = (t - 4) * (RND() * 3) % 1
if t1 > 0 then
cx = cx + t1
if cx > 6 then
say 'Your oranges have spoiled. Haul them to the dump!'
else do
say 'Collect six-and-a-half cents per pound for good oranges.'
xt = 0.065 * wl
say ' Total for the load: $'xt
if cx >= 1 then do
say ' Part of the load is damaged. Subtract '5 * cx'%.'
xt = xt - xt * cx / 20
say ' Net payment is $'xt
end
end
end
else if ct = 2 then do
xt = 0.05 * wl
say 'Collect five cents a pound for freight.'
say ' Total for load is $'xt
if hr >= 95 then do
say " You're late!! Subtract ten percent penalty."
xt = xt * 0.9
say ' Net payment is $'xt
end
end
else do
say 'Postmaster pays 4.75 cents per pound on delivery.'
xt = 0.0475 * wl
end
say ' '
xt = xt - xc
if xt >= 0 then do
say 'Your net profit this trip was $'xt
if xt > 100 then
say ' G O O D W O R K !!'
if xt < 200 then
say " You'd make more money washing dishes !"
sh_keep_on_trucking = 0
end
else do
say 'Bad trip. . . You lost $'abs(xt)
say 'You are bankrupt !!!'
call Delay 200
call GiveUpTruck
end
return 0
FormatSim:
arg number, before
/*
------------------------------------------------------------------------
Format a specified number of digits before the decimal point
(simulating REXX FORMAT function which is not available in ARexx)
------------------------------------------------------------------------
*/
shdigits = digits()
numeric digits before
shformattemp = number + 0
numeric digits shdigits
return shformattemp
GetNum: procedure expose rxenv rxpull
/*
------------------------------------------------------------------------
Get a numeric data from the console/keyboard
------------------------------------------------------------------------
*/
do forever
shnum = space(translate(GetStr(), '', ','), 0)
if datatype(shnum, 'N') then
leave
end
return shnum
GetStr: procedure expose rxenv rxpull
/*
------------------------------------------------------------------------
Get a string of characters from the console/keyboard
------------------------------------------------------------------------
*/
shstr = ''
interpret rxpull
if shstr = '*' then do /* allow user to exit at any time
by entering '*' at any prompt */
say 'Thank you for playing Trucker under...'
say rxenv
exit 0
end
return shstr
GiveUpTruck: procedure expose sh_keep_on_trucking
/*
------------------------------------------------------------------------
Give up the truck due to financial problems or trafic violations
------------------------------------------------------------------------
*/
say ' '
say 'Your rig has been repossessed...'
call Delay 250
sh_keep_on_trucking = 0
return 0
InitialGame:
/*
------------------------------------------------------------------------
Initial game variables
------------------------------------------------------------------------
*/
call CheckOS
call ShowBanner
cx = 0
hl = 3
hr = 0
hs = 7
mf = 0
np = 1
ns = 0
nt = 0
sl = 55
tc = 10
ts = 1
wf = 190
xc = 190
ntX.1 = 'first'
ntX.2 = 'second'
ntX.3 = 'third'
ntX.4 = 'fourth'
dsX.0 = 'Monday'
dsX.1 = 'Tuesday'
dsX.2 = 'Wednesday'
dsX.3 = 'Thursday'
dsX.4 = 'Friday'
dsX.5 = 'Saturday'
dsX.6 = 'Sunday'
sh_keep_on_trucking = 1 /* switch, 0 = end of loop */
call Delay 100
interpret rxext
call GetStr
interpret rxcls
call ReportTripDuration hr
say 'You are at the Los Angeles trucking terminal.'
say 'Three types of cargo are available:'
say ' '
say " 1--Oranges (highest profit if they don't spoil)"
say ' 2--Freight forwarding (penalty for late delivery)'
say ' 3--U.S. Mail (lowest rate, but no hurry to arrive)'
say ' '
say 'The cargo is due in New York by 4 PM on Thursday.'
say ' '
say 'Which type of cargo do you want (1, 2 or 3)?'
do forever
ct = GetStr()
if length(ct) = 1 & pos(ct, '123') > 0 then
leave
end
wl = 0
do while wl < 25000
say 'How many pounds will you carry (40,000 is the legal limit)?'
wl = GetNum()
if wl < 25000 then
say "You can't make a living on half a load."
end
say ' '
say ' They are loading your truck now.'
call Delay (wl % 100)
if wl > 50000 then do
wl = 50000
say ' 50,000 pounds of cargo has filled your trailer!'
call Delay 250
end
interpret rxcls
hr = hr + 1
call ReportTripDuration hr
say 'You paid $190.00 for a nearly full tank of diesel fuel.'
say ' '
say 'Two of your tires are worn. Do you want replacements (Y or N)?'
do forever
ikeyX = GetStr()
if length(ikeyX) = 1 & pos(ikeyX, 'NY') > 0 then
leave
end
if ikeyX = 'Y' then do
say 'A new tire costs $200.00. A retread costs $100.00.'
say ' Which type do you want (N=new or R=retread)?'
do forever
zX = GetStr()
if length(zX) = 1 & pos(zX, 'NR') > 0 then
leave
end
say ' How many (0-3)?'
do forever
tno = GetStr()
if length(tno) = 1 & pos(tno, '0123') > 0 then
leave
end
if tno > 0 then do
ts = ts + tno - 2
if zX = 'R' then do
tc = tc - 1.5 * tno
xc = xc + 100 * tno
end
else do
tc = tc - 2 * tno
xc = xc + 200 * tno
end
end
end
say ' '
say 'You may choose the N(orthern), M(iddle) or S(outhern) route.'
say ' Which route do you choose (N, M or S)?'
do forever
ikeyX = GetStr()
if length(ikeyX) = 1 & pos(ikeyX, 'MNS') > 0 then
leave
end
say ' '
if ikeyX = 'N' then do
rt = 1
rh = 4
mt.1 = 2710
mp.1.1 = 90; mpX.1.1 = 'Barstow';
mrX.1.1 = 'I-15 in California'; zm.1.1 = 7.80
mp.1.2 = 245; mpX.1.2 = 'Las Vegas';
mrX.1.2 = 'I-15 in California'; zm.1.2 = 1.00
mp.1.3 = 365; mpX.1.3 = 'Utah border';
mrX.1.3 = 'I-15 in Arizona'; zm.1.3 = 0.00
mp.1.4 = 500; mpX.1.4 = 'End of Interstate';
mrX.1.4 = 'I-15 in Utah'; zm.1.4 = 3.20
mp.1.5 = 555; mpX.1.5 = 'Salina';
mrX.1.5 = 'US-89 in Utah'; zm.1.5 = 4.50
mp.1.6 = 760; mpX.1.6 = 'Grand Junction';
mrX.1.6 = 'I-70 in Utah'; zm.1.6 = 5.40
mp.1.7 = 1010; mpX.1.7 = 'Denver';
mrX.1.7 = 'I-70 in Colorado'; zm.1.7 = 3.75
mp.1.8 = 1190; mpX.1.8 = 'Nebraska border';
mrX.1.8 = 'I-76 in Colorado'; zm.1.8 = 1.00
mp.1.9 = 1450; mpX.1.9 = 'Omaha';
mrX.1.9 = 'I-80 in Nebraska'; zm.1.9 = 5.50
mp.1.10 = 1590; mpX.1.10 = 'Demoines';
mrX.1.10 = 'I-80 in Iowa'; zm.1.10 = 4.75
mp.1.11 = 1750; mpX.1.11 = 'Illinois border';
mrX.1.11 = 'I-80 in Iowa'; zm.1.11 = 5.60
mp.1.12 = 1910; mpX.1.12 = 'Gary';
mrX.1.12 = 'I-80 in Illinois'; zm.1.12 = 2.50
mp.1.13 = 2050; mpX.1.13 = 'Ohio border';
mrX.1.13 = 'Indianna Turnpike'; zm.1.13 = 2.45
mp.1.14 = 2215; mpX.1.14 = 'Cleveland';
mrX.1.14 = 'Ohio Turnpike'; zm.1.14 = 2.80
mp.1.15 = 2280; mpX.1.15 = 'Pennsylvania border';
mrX.1.15 = 'I-80 in Ohio'; zm.1.15 = 4.16
mp.1.16 = 2615; mpX.1.16 = 'East Stroudsberg';
mrX.1.16 = 'I-80 in Pennsylvania'; zm.1.16 = 3.33
mp.1.17 = 2675; mpX.1.17 = 'Washington Bridge';
mrX.1.17 = 'I-80 in New Jersey'; zm.1.17 = 2.20
mp.1.18 = 9999; mpX.1.18 = 'New York';
mrX.1.18 = 'city streets'; zm.1.18 = 8.00
end
else if ikeyX = 'M' then do
rt = 0
rh = 2
mt.0 = 2850
mp.0.1 = 90; mpX.0.1 = 'Barstow';
mrX.0.1 = 'I-15 in California'; zm.0.1 = 7.80
mp.0.2 = 225; mpX.0.2 = 'Needles';
mrX.0.2 = 'I-40 in California'; zm.0.2 = 1.00
mp.0.3 = 440; mpX.0.3 = 'Flagstaff';
mrX.0.3 = 'I-40 in California'; zm.0.3 = 3.65
mp.0.4 = 620; mpX.0.4 = 'Gallup';
mrX.0.4 = 'I-40 in Arizona'; zm.0.4 = 5.50
mp.0.5 = 760; mpX.0.5 = 'Albuquerque';
mrX.0.5 = 'I-40 in New Mexico'; zm.0.5 = 3.35
mp.0.6 = 930; mpX.0.6 = 'Tucumcari';
mrX.0.6 = 'I-40 in New Mexico'; zm.0.6 = 1.00
mp.0.7 = 1040; mpX.0.7 = 'Amarillo';
mrX.0.7 = 'I-40 in Texas'; zm.0.7 = 7.80
mp.0.8 = 1155; mpX.0.8 = 'Oklahoma border';
mrX.0.8 = 'I-40 in Texas'; zm.0.8 = 5.50
mp.0.9 = 1305; mpX.0.9 = 'Oklahoma City';
mrX.0.9 = 'I-40 in Oklahoma'; zm.0.9 = 2.65
mp.0.10 = 1530; mpX.0.10 = 'Missouri border';
mrX.0.10 = 'Oklahoma Turnpike'; zm.0.10 = 2.40
mp.0.11 = 1815; mpX.0.11 = 'St. Louis';
mrX.0.11 = 'I-44 in Missouri'; zm.0.11 = 0.00
mp.0.12 = 1980; mpX.0.12 = 'Terre Haute';
mrX.0.12 = 'I-70 in Illinois'; zm.0.12 = 5.50
mp.0.13 = 2050; mpX.0.13 = 'Indianapolis';
mrX.0.13 = 'I-70 in Indianna'; zm.0.13 = 0.00
mp.0.14 = 2115; mpX.0.14 = 'Ohio border';
mrX.0.14 = 'I-70 in Indianna'; zm.0.14 = 1.00
mp.0.15 = 2220; mpX.0.15 = 'Columbus';
mrX.0.15 = 'I-70 in Ohio'; zm.0.15 = 4.25
mp.0.16 = 2350; mpX.0.16 = 'Wheeling West Virginia';
mrX.0.16 = 'I-70 in Ohio'; zm.0.16 = 4.25
mp.0.17 = 2410; mpX.0.17 = 'New Stanton';
mrX.0.17 = 'I-70 in Pennsylvania'; zm.0.17 = 6.75
mp.0.18 = 2570; mpX.0.18 = 'Harrisburg';
mrX.0.18 = 'Pennsylvania Turnpike'; zm.0.18 = 3.75
mp.0.19 = 2760; mpX.0.19 = 'New Jersey border';
mrX.0.19 = 'Pennsylvania Turnpike'; zm.0.19 = 2.95
mp.0.20 = 2840; mpX.0.20 = 'Holland Tunnel';
mrX.0.20 = 'I-70 in New Jersey'; zm.0.20 = 2.40
mp.0.21 = 9999; mpX.0.21 = 'New York';
mrX.0.21 = 'New York streets'; zm.0.21 = 8.00
end
else do
rt = 2
rh = 1
mt.2 = 3120
mp.2.1 = 75; mpX.2.1 = 'Palm Springs';
mrX.2.1 = 'I-10 in California'; zm.2.1 = 0.00
mp.2.2 = 225; mpX.2.2 = 'Blythe';
mrX.2.2 = 'I-10 in California'; zm.2.2 = 1.00
mp.2.3 = 375; mpX.2.3 = 'Phoenix';
mrX.2.3 = 'I-10 in Arizona'; zm.2.3 = 0.00
mp.2.4 = 495; mpX.2.4 = 'Tucson';
mrX.2.4 = 'I-10 in Arizona'; zm.2.4 = 7.90
mp.2.5 = 650; mpX.2.5 = 'Lordsburg';
mrX.2.5 = 'I-10 in Arizona'; zm.2.5 = 5.75
mp.2.6 = 795; mpX.2.6 = 'El Paso';
mrX.2.6 = 'I-10 in New Mexico'; zm.2.6 = 0.00
mp.2.7 = 965; mpX.2.7 = 'Pecos';
mrX.2.7 = 'I-10 in Texas'; zm.2.7 = 1.00
mp.2.8 = 1080; mpX.2.8 = 'Odessa';
mrX.2.8 = 'I-20 in Texas'; zm.2.8 = 0.00
mp.2.9 = 1250; mpX.2.9 = 'Abilene';
mrX.2.9 = 'I-20 in Texas'; zm.2.9 = 3.80
mp.2.10 = 1439; mpX.2.10 = 'Dallas';
mrX.2.10 = 'I-20 in Texas'; zm.2.10 = 0.00
mp.2.11 = 1610; mpX.2.11 = 'Louisiana border';
mrX.2.11 = 'I-20 in Texas'; zm.2.11 = 5.00
mp.2.12 = 1785; mpX.2.12 = 'Vicksburg';
mrX.2.12 = 'I-20 in Louisiana'; zm.2.12 = 0.00
mp.2.13 = 1965; mpX.2.13 = 'Alabama border';
mrX.2.13 = 'I-20 in Mississippi'; zm.2.13 = 1.00
mp.2.14 = 2100; mpX.2.14 = 'Birmingham';
mrX.2.14 = 'I-20 in Alabama'; zm.2.14 = 4.25
mp.2.15 = 2200; mpX.2.15 = 'Georgia border';
mrX.2.15 = 'I-20 in Alabama'; zm.2.15 = 0.00
mp.2.16 = 2255; mpX.2.16 = 'Atlanta';
mrX.2.16 = 'I-20 in Georgia'; zm.2.16 = 0.00
mp.2.17 = 2320; mpX.2.17 = 'Carolina border';
mrX.2.17 = 'I-85 in Georgia'; zm.2.17 = 5.75
mp.2.18 = 2565; mpX.2.18 = 'Greensboro';
mrX.2.18 = 'I-85 in Carolina'; zm.2.18 = 3.80
mp.2.19 = 2680; mpX.2.19 = 'Virginia border';
mrX.2.19 = 'I-85 in North Carolina';zm.2.19 = 7.85
mp.2.20 = 2775; mpX.2.20 = 'Richmond';
mrX.2.20 = 'I-85 in Virginia'; zm.2.20 = 0.00
mp.2.21 = 2880; mpX.2.21 = 'Washington D.C.';
mrX.2.21 = 'I-95 in Virginia'; zm.2.21 = 0.00
mp.2.22 = 2920; mpX.2.22 = 'Baltimore';
mrX.2.22 = 'I-95 in Maryland'; zm.2.22 = 2.30
mp.2.23 = 2990; mpX.2.23 = 'New Jersey border';
mrX.2.23 = 'I-95 in Delaware'; zm.2.23 = 2.25
mp.2.24 = 3110; mpX.2.24 = 'Holland Tunnel';
mrX.2.24 = 'New Jersey Turnpike'; zm.2.24 = 2.40
mp.2.25 = 9999; mpX.2.25 = 'New York';
mrX.2.25 = 'city streets'; zm.2.25 = 8.00
end
return 0
NearTruckStop:
/*
------------------------------------------------------------------------
Come close to a truck stop
------------------------------------------------------------------------
*/
say 'Truck stop ahead. Do you want to stop (Y or N)? '
shsleep_sw = 0 /* switch, 1 = has rested/slept */
do forever
do forever
ikeyX = GetStr()
if length(ikeyX) = 1 & pos(ikeyX, 'NY') > 0 then
leave
end
if ikeyX = 'N' then do
hl = hl + 1
leave
end
t = 85 + 35 * RND() % 1
say 'Diesel fuel costs $'t/100' per gallon.'
say ' How many gallons do you want?'
do forever
t1 = translate(strip(GetStr()))
if t1 = 'FILL' |,
t1 = 'FULL' |,
space(t1, 0) = 'FILLUP' then
t1 = (200 - wf) % 1
if datatype(t1, 'N') then
leave
end
if t1 > 0 then do
say 'Pay $'t * t1 / 100
xc = xc + t * t1 / 100
wf = wf + t1
end
say 'So far, you have spent $'xc
if wf > 200 then do
say 'Your tank only holds 200 gallons ...'
say FormatSim(wf - 200, 4) 'gallons spilled !!'
wf = 200
end
if ts <= 0 then do
t = 200 + 50 * RND() % 1
t1 = 100 + 70 * RND() % 1
say 'A new tire costs $'t' A retread costs $'t1
say ' Do you want to buy a tire (Y or N)?'
do forever
ikeyX = GetStr()
if length(ikeyX) = 1 & pos(ikeyX, 'NY') > 0 then
leave
end
if ikeyX = 'Y' then do
say ' Which type do you want (N=new or R=retread)?'
do forever
zX = GetStr()
if length(zX) = 1 & pos(zX, 'NR') > 0 then
leave
end
say ' How many (0-3)?'
do forever
tno = GetStr()
if length(tno) = 1 & pos(tno, '0123') > 0 then
leave
end
if tno > 0 then do
ts = tno - 1
if zX = 'R' then do
tc = tc - 0.5 * tno
xc = xc + t1 * tno
end
else do
tc = tc - tno
xc = xc + t * tno
end
end
end
end
if shsleep_sw then do
say ' '
leave
end
hr = hr + 1
ns = 0
say 'Do you want to get some sleep (Y or N)?'
do forever
ikeyX = GetStr()
if length(ikeyX) = 1 & pos(ikeyX, 'NY') > 0 then
leave
end
if ikeyX = 'N' then do
say ' '
call ReportTripDuration hr
leave
end
say ' How many hours of rest?'
t = GetNum()
if t < 1 then
leave
shsleep_sw = 1
dh = hr + 7 - 24 * ((hr + 7) % 24)
hr = hr + t
call Delay (50 * t)
if ct = 1 then do
wf = wf - 7 * t
if wf < 0 then do
wf = 0
call CalcSpoilFactor
end
end
if dh > 3 &,
dh < 20 then do
t = (t / 2 + 0.6) % 1
say "Thanks to your neighbors' noise, you got only "t,
"hours real sleep."
call Delay 200
end
hs = hs + t
if t > 3 then
hl = 0
else
hl = hl / 2
shf = 5000
shd = 100
do 3
interpret rxbeep
call Delay 50
end
shd = 350
interpret rxbeep
interpret rxcls
call ReportTripDuration hr
say 'Time to hit the road again.'
say ' '
call CheckPhysical
say 'You now have 'wf % 1' gallons of fuel.'
say 'Do you want to buy more (Y or N)?'
end
return 0
ReportTripDuration: procedure expose dsX. dh
arg hr
/*
------------------------------------------------------------------------
Report calculated trip duration in days and hours
------------------------------------------------------------------------
*/
dh = hr + 8
shdt = dh % 24
dh = dh - 24 * shdt
do while shdt > 6
shdt = shdt - 7
end
dmX = 'AM'
if dh = 12 then
dmX = 'Noon'
else do
if dh > 12 then do
dh = dh - 12
dmX = 'PM'
end
if dh = 0 then do
dh = 12
dmX = 'Midnight'
end
end
say ' '
say 'Day: 'dsX.shdt
say 'Time: 'FormatSim(dh, 2)' 'dmX
say ' '
return 0
RND: procedure
/*
------------------------------------------------------------------------
Generate a random number between 0.0000 and 1.0000
------------------------------------------------------------------------
*/
return random(0, 10000) / 10000
ShowBanner: procedure
/*
------------------------------------------------------------------------
Show the game banner
------------------------------------------------------------------------
*/
sh.1 =,
'TTTTTTTTT RRRRRRR UUU UUU CCCCCC KKK KKK EEEEEEEEE RRRRRRR'
sh.2 =,
' TTT RRR RRR UUU UUU CCC CCC KKK KKK EEE RRR RRR'
sh.3 =,
' TTT RRR RRR UUU UUU CCC KKK KKK EEE RRR RRR'
sh.4 =,
' TTT RRR RRR UUU UUU CCC KKKKKK EEE RRR RRR'
sh.5 =,
' TTT RRRRRRR UUU UUU CCC KKKKK EEEEE RRRRRRR'
sh.6 =,
' TTT RRRRRR UUU UUU CCC KKKKKK EEE RRRRRR'
sh.7 =,
' TTT RRR RRR UUU UUU CCC KKK KKK EEE RRR RRR'
sh.8 =,
' TTT RRR RRR UUU UUU CCC CCC KKK KKK EEE RRR RRR'
sh.9 =,
' TTT RRR RRR UUUUUUU CCCCCC KKK KKK EEEEEEEEE RRR RRR'
say ' '
do shi = 1 to 9
say ' 'sh.shi
say ' 'sh.shi
end
say ' '
drop sh.
return 0
SQRT: procedure
arg x
/*
------------------------------------------------------------------------
Return the SQUARE ROOT of the argument X calculated according to
Newton-Raphson algorithm
------------------------------------------------------------------------
*/
arg = abs(x)
root = arg / 2
if root > 0 then do digits()
root = (root + arg / root) / 2
if abs(root ** 2 - arg) / arg - 0.000001 <= 0 then
leave
end
return root
StopByEmptyTank:
/*
------------------------------------------------------------------------
Stop the truck due to empty gasoline tank
------------------------------------------------------------------------
*/
t1 = t1 + wf
wf = 0
sp = 0
t = (4.5 - 0.2 * t) * t1
mf = mf + (t % 1)
say 'After' FormatSim(t, 4),
'more miles, you ran out of fuel (DUMMY !!)'
call WaitForGasDelivery
return 0
StopForPolice:
/*
------------------------------------------------------------------------
Stop and face the police due to a trafic violation
------------------------------------------------------------------------
*/
say 'Smokey is behind you with his lights on. Pull over!'
shd = 400
do 3
shf = 3000
interpret rxbeep
shf = 2500
interpret rxbeep
end
nt = nt + 1
say 'See the justice of the peace for your 'ntX.nt' offense.'
say ' Wait 'nt' hours for your hearing...'
hl = hl + nt
hr = hr + nt
if nt <= 3 then do
t = (nt * (RND() * 5)) % 1
t1 = (5 * (rt + nt * (RND() * 4))) % 1
say ' The fine is $'t1' plus $'t' for each MPH over the limit.'
say ' Pay $'t1 + t * (sp - sl)
xc = xc + t1 + t * (sp - sl)
call Delay (nt * 500)
return 0
end
say 'You are sentenced to 30 days in jail for reckless driving.'
call Delay 300
say "Your I.C.C. driver's license is revoked !"
call GiveUpTruck
return 0
TruckTheJourney:
/*
------------------------------------------------------------------------
Go trucking coast to coast (main program loop)
------------------------------------------------------------------------
*/
do while mp.rt.np <= mf
call CheckObstacles
if sh_keep_on_trucking then
nop
else
return 0
end
say 'Cruising on 'mrX.rt.np
call CheckPhysical
say 'You are feeling 'cdX
call CheckWheater
say 'Current weather: 'crX
ns = ns + 1
if ns > 3 then
call NearTruckStop
sp = 0
maxsp = (1.5 * sl) % 1
do while sp < 20 |,
sp > maxsp
say 'How fast do you wish to go (20-100)?'
sp = GetNum()
sp = (sp + 0.5) % 1 /* Round it up */
if sp < 20 then
say 'Your have to go at least 20 --'
if sp > maxsp then
say 'You can only get the old rig to go 'maxsp'MPH on this road.'
end
af = sp ** 2 * cd * cr
if af > RND() * 10000000 then do
do shf = 1000 to 10 by -50
shd = shf % 10
interpret rxbeep
interpret rxcls
say ' '
say 'C R A S H !!'
end
say ' '
if cd = 100 |,
(cd = 25 & sp < 65) then
say 'You fell asleep at the wheel.'
else if cr = 50 then
say 'You drove off the road into a snow filled ditch.'
else if cr = 10 then
say 'You rear-ended a pick-up with no tail lights.'
else if sp > 65 then
say ' Speed kills !'
else if cd > 2 then do
say 'You hit a slick spot... !@#$%^...'
call Delay 500
say ' ... and !@#$%^... skidded off the road.'
end
else
say 'A drunk driver rammed your rig. !@#$%^... Tough luck !'
say ' '
call Delay 350
say 'You lose your truck & profits.'
sh_keep_on_trucking = 0
return 0
end
tc = tc + 0.00005 * sp * wl / 40000
af = SQRT(mf + 100) * tc
if af > rh * 25000 * RND() then
call ChangeFlatTire
if sp > sl - rh + 10 then do
if (sp - sl + 2 * rh - 5) ** 2 >= 900 * RND() then do
call StopForPolice
if sh_keep_on_trucking then
nop
else
return 0
end
end
hl = hl + 1
hr = hr + 1
if sl < 40 then
sl = 55
t = abs(55 - sp)
if t > 12 then
t = 12.5
t1 = sp / (4.5 - 0.2 * t)
wf = wf - t1
if wf < 0 then
call StopByEmptyTank
mf = mf + sp
if mf >= mt.rt then
call EndOfTrip
if sh_keep_on_trucking then do
call Delay 25
interpret rxcls
call ReportTripDuration hr
say 'Approximate fuel:' ((wf - 4 + RND() * 10) % 1)
say 'Speed: 'sp
say 'Odometer: 'mf
say 'Miles to go: 'mt.rt - mf
say ' '
end
return 0
WaitForGasDelivery:
/*
------------------------------------------------------------------------
Wait for gas to be delivered
------------------------------------------------------------------------
*/
say ' It cost $200 to get a barrel of diesel delivered.'
wf = 55
t1 = 1 + (RND() * 5) % 1
xc = xc + 200
hl = hl + t1
hr = hr + t1
say ' You also wasted 't1' hours by your carelessness.'
call CalcSpoilFactor
return 0
/*
========================================================================
NOTES:
========================================================================
------------------------------------------------------------------------
Descriptions of important variables in 'TRUCKER'
------------------------------------------------------------------------
af = all (reusable) failure code
cd = code of condition/mood of the trucker (1:good, ..., 100:worst)
cdX = condition/mood of the trucker
cr = condition of the weather code (1:good, ..., 50:worst)
crX = condition of the weather
ct = cargo type (1, 2 or 3)
cx = condition of the load (okay if smaller than 1)
dh = day hour (time in day)
dsX = day script (day in word)
hl = hours labored (hours continuously worked)
hr = hours ridden (total elapse time away from LA)
hs = hours slept (total)
hsw1 = help switch
ikeyX = input character string
intzh = integer(zh)
maxsp = maximum speed the truck can handle
mf = miles covered
mp = milestone place number (where the truck is)
mpX = milestone place name (city/town at mp)
mrX = milestone road name (highway/street name at mp)
mt = mile total between LA and NY for the chosen route
np = number of place (milestone number)
ns = number of stations passed after last stop
nt = number of traffic violations
ntX = number of traffic violations in word
rh = road quality (1 = better, 4 = worst)
rt = route (1 = North, 0 = Middle, 2 = South)
rx.. = variables with REXX system specific commands to be interpreted
sh.. = Simon Husin's work, temporary and reusable variables
sl = speed limit imposed
sp = speed
t.. = temporary and reusable variables
tc = tire condition (0 = best, 10 = okay, etc.)
tno = number of tires purchased
ts = tire spared
wf = work fuel (estimate volume of fuel available in tank)
wl = work load (total pounds of load)
xc = trip expenses
xt = trip final financial result
zh = same as zm
zm = standard hindrance factor at milestone mp
zx = tire type (N=new or R=retread)
------------------------------------------------------------------------
Compatibility Issues:
------------------------------------------------------------------------
1. This program is using IF THEN NOP ELSE ... and (x < y | x > y)
constructions rather than \ or \= to make it run under ARexx which is
using tilde (~) as the NOT sign.
Solutions applied to complement ARexx shortcomings:
- FORMATSIM(...) instead of FORMAT(...)
- LENGTH(...) = 1 & POS(...) instead of WORDPOS(...)
- A 80-character title has been replaced with two short title lines
to avoid the line to wrap around on the output window
Solutions applied to complement REXX/Windows shortcomings:
- Parse Source has been moved to the main program to avoid problems
with REXX/Windows running with the Intel 386(-compatible) processor
Solutions applied to complement ARexx and uni-REXX shortcomings:
- Exponential notation (e.g. 1E4, 1E-6, etc.) has been replaced with
conventional notation (e.g. 10000, 0.000001, etc.)
2. IBM Mainframe and AS/400 users:
This program will run without any changes in your environment. You
might want to check first whether the character '|' gets converted
correctly (to a whole vertical bar) or to a broken vertical bar. In
the latter case, replace all broken bars with whole ones, then... hit
the road!
The first release of the program was successfully compiled with
IBM Compiler REXX/370 (release 2.0) on June 25th, 1993.
The compiler reported zero errors and zero warnings.
Just in case you don't know:
The MVS/TSO or VM/CMS implementation of REXX supports the millionth
of a second (1E-6) in the E and L options of the TIME function.
3. PC users:
a) Personal REXX:
This program has been tested with Quercus Systems Personal REXX under
DOS, Windows and OS/2 (16-bit and 32-bit) without any problems.
In DOS environment:
- first create the object code with /O/NM option
- due to the QUEUE instruction, needed to accomodate REXX/Windows'
shortcomings, you must first run RXINTMGR and STACKMGR before
executing this program
DELAY(n) and REXXLIB functions COS(n) and SQRT(n) are not used to
simplify this program's portability.
b) Portable/REXX:
Built-in functions COS(n), DELAY(n) and SQRT(n) are not used to
simplify this program's portability.
Although the components, tested separately do work, this entire
program has been tested with Portable/REXX Versions 1.10 and 1.30
without any success (system resources exhausted).
c) REXX/Windows:
This program will run without any changes in REXX/Windows.
The shortcomings in the interpreter mentioned in point number 1 were
detected only on 386-based computers caused by the PARSE SOURCE on
line 401 which resides within a function. The interpreter has
since been fixed.
d) Tritus SPF
Tritus allows only 32000-byte or smaller REXX programs to be run via
its REXX primary command.
For the experiments below, I removed all comment lines and also lines
1039 through 1140 (route Middle and South array data).
Under DOS (TSPFP):
The program has been tested with TSPF 1.2.5. without any problems.
Under OS/2 (TSPFP): (in this case, it is using installed OS/2 REXX)
The program has been tested with TSPF 1.2.5. without any problems.
e) OS/2 Procedures Language/2 REXX:
Built-in function SysSleep(n), and functions SQRT(n) and COS(n)
supported by RXMATHFN library are not used to simplify this program's
portability.
OS/2 2.x REXX Utility 'SYSCLS' is not used despite the fact that it
is a bit faster and 'cleaner' than the OS/2 command clear screen
(CLS) because the latter maintains the screen colors better than the
first.
Although PULL is supported by OS/2, earlier versions (before 2.0)
have one difference with the same command in other interpreters,
i.e. it shows a blank line with '?' followed by the actual prompt
on the next line.
4. Unix/AIX users:
This program will run without any changes in uni-REXX.
The shortcomings in the interpreter mentioned in point number 1 were
detected by The Workstation Group. The interpreter has since been
fixed.
5. The use of interpret command slows down the execution of the
program, yet it is used to ensure and ease compatibility accross
platforms.
6. TRUCKxxx functions have been created for those (xxx) interpreters
which support cursor positioning on the screen. This approach was
chosen, instead of the INTERPRET instruction executing the cursor
positioning function, to achieve the maximum speed of the 'animation'
of the 'truck' on the screen.
The same can be created for the mainframe computers equipped with a
Dialog Manager (ISPF/VM), by creating a panel member.
7. LINEIN(CON) is a function that is supported only by OS/2, Personal
REXX and Portable/REXX interpreters.
It is comparable with the PARSE PULL command in that the entered
alphabetical characters are NOT translated into uppercase.
------------------------------------------------------------------------
------------------------------------------------------------------------
Thanks
------------------------------------------------------------------------
I would like to thank the following people for helping me in creating
and enhancing this program:
- Mr. Cooper, Kerry (Nybbles & Bytes, Tacoma, WA - Amiga Dealer)
- Mr. Daney, Charles (Quercus Systems)
- Mr. Clark, Jeff (Eddie Bauer, WA - AS/400 Expert)
- Mr. Glantzberg, Hughes (Himself)
- Mr. Kenney, Barry (Blue Cross of Washington and Alaska)
- Mr. Slayton, Bill (Blue Cross of Washington and Alaska)
- Mr. Spire, Ed (The Workstation Group)
- Ms. Taylor, Pam (The Workstation Group)
- Mr. VanDewater, BJ (IBM, Vienna, Austria - REXX/370 Compiler)
- Mr. Watts, Keith (Kilowatt Software)
------------------------------------------------------------------------
------------------------------------------------------------------------
Comments
------------------------------------------------------------------------
For comments, tech-exchange, and/or more information, please send your
letter to:
GLOBAL AUTOMATION COMPANY
23901 114TH PLACE S.E.
KENT, WA 98031-3417
U.S.A.
or fax it to:
1-206-813-8202
========================================================================
*/