Original Usenet thread from alt.ascii-art, started 21 Jan 1998.
Ascii Maze Generator for the HP48
alt.ascii-art
· 4 messages · 21 Jan 1998 - 23 Jan 1998
Amazing
An Ascii Maze Generator for the HP48s/g Calculators.
A Program in Basic Translated to RPL.
This program was found in:
BASIC Computer Games: MicroComputer Edition
101 Great Games to play on Your Home Computer.
Edited by David H. Ahl
Workman Publishing Copyright 1978
The Original Programs Author was Jack Hauber.
This translation to UserRPL
is by TinyWanda. January 1998
...........................................
The En-soi ( Thing in itself )
Amazing
Amazing was written in the ancient days of Basic, and is a psuedo-graphical
program that creates a unique maze, with the width & height defined by the
user, drawn with ordinary typographical characters.
Such as this:
%%HP: T(1)A(D)F(.);
"Amazing Maze
15 By 15
.--.--.--.--.--.--.--. .--.--.--.--.--.--.--.
I I I I I I
: :--: :--:--:--:--: :--: : : : : : :
I I I I I I I I
:--: :--: : :--:--:--: :--:--:--: : : :
I I I I I I I I I
:--:--: :--: :--: : :--:--: : : : : :
I I I I I I I I
: :--:--: :--: : :--: :--:--: : :--:--:
I I I I I I I I I
:--:--:--:--: :--:--: :--: :--: : : : :
I I I I I I I I I
: : : :--: : : :--: :--: : :--:--: :
I I I I I I I I I I I
: : :--: : : :--: :--:--:--:--: : : :
I I I I I I I I
:--:--: :--:--:--: :--: :--:--: : :--:--:
I I I I I I I I I
: : :--: : : :--:--:--: : : : : : :
I I I I I I I I I I I
: : : :--:-- :--: : :--:
I I I I I I I I I I
: :--:--: : :--:--:--:--: : : :--:--: :
I I I I I I I I I I
: :--: : :--: : : : :--:--: : : : :
I I I I I I I I I I I I
: : :--: : :--: :--:--: : : : :--: :
I I I I I I I I I
: : :--: :--: :--:--:--:--: :--: : : :
I I I I I I I I
: :--: :--:--:--: :--:--: :--: :--:--:--:
I I I I I I I
: : :--:--:--:--: : :--:--: : :--:--: :
I I I I I I I I I I
: :--: : : : :--: : :--: :--: : :--:
I I I I I I I I I I
: :--:--: : : : :--:--: :--: :--:--: :
I I I I I I I I I I
: : : :--: : : : : : :--:--: : :--:
I I I I I I I I I I I
: :--:--: : : : : :--: :--:--:--: : :
I I I I I I I I I I
:--:--: :--:--: :--: : : : :--: : : :
I I I I I I I I I I I
: :--:--: :--: : :--: : : : :--: : :
I I I I I I I I I I
:--:--: : : : :--:--:--:--: : : : : :
I I I I I I I I I I I
: : : :--: : :--: : : : :--: : :--:
I I I I I I I
:--:--:--:--:--:--:--:--:--:--:--: :--:--:--:
"
.............................
The Directory consists of Eight Objects:
Start The Maze Creator
->. Holds the Number used to Name/Store the Mazes
->Sto Bonus Program
Abc Bonus Program used to Name/Store the Mazes
Cba Bonus Program; Inversion of Abc
? Display Routine for Countdown
Alrm Bonus Program to alert you that it�s done
Lines List of BasicLines/RPL-Programs
.............................
To Use Start
Start incorporates the double click feature!
Double Click on Start;
And an Input prompt appears urging you to define the Width and Height of the
Maze to be created.
Or-
Load the Stack with the width and height,
and click on Start, or activate Start from another program.
2: real integer Width
1: real integer Height
While the program is running, it displays a countdown to let you know that it�s
making some progress in creating the maze, as this process is -really- very
slow...!!!
It also displays the Line/Object that is currently being evaluated...???...it
may seem that occasionally, particularly toward the end of the maze
calculations, that the program will conk-out and get trapped in a dead-end
loop...but...if you wait, and wait some more, suddenly, contrary to you�re
expectations, it will slowly begin to creep towards the end of it�s
calculations again...???
The display will countdown once for the calculations phase, and again for the
�drawing� phase, the drawing phase is comparatively much quicker!
When it�s done, an alarm will go off.
To shut it off, simply hit ON.
The program will also store the Maze under a unique name, defined by the ->.
variable, in conjunction with the Abc program which takes any number and
converts it to a zeroless base 26 number ( A-Z & beyound ).
Just to be sure that these names don�t conflict with any of the variables used
by Start, each name is prefixed with a RightArrow.
The Bonus program ->Sto has been gratuitously included.
->Sto allows you to store several variables from the stack, in several
different ways, by using a bit of AI, in one quick step.
Auto Store is designed to store Global Variables in that Local Variable Manner
that is So Much more Friendly...!!!
->Sto uses a bit of Artificial Intelligence (???) to figure out What is on the
Stack and how and what should be stored under which Names...!!!
The Stack configurations that are allowed are:
6: Object A
5: Object B
4: Object C
3: 'A'
2: 'B'
1: 'C'
This structure, above, allows for any number of Objects and Names to be on the
Stack, just so long as the bottom most object to be stored, Object C in this
example, is not a Type 6 or 7 ( A Global or Local Name ).
4: Object A
3: Object B
2: Object C
1: { A B C }
Again; this allows for any number of Objects and Names...
4: A: Object
3: B: Object
2: C: Object
1: 3
or
1: A: Object
Position 1: Refers to the number of the Tagged Objects to be stored, If any of
the Tags would form an Illegal Name, then That Object and it's Tag will be left
on the Stack.
If there in Only one Tagged Object to be Stored, then It may be left alone in
Position 1:
1: Real Number
In this case, the Number is the Stored under the Number itself, prefixed with
Character (183), the tiny dot.
For Optimum Ease of Use, Reference this Program through a UserKey... �->Sto�
32 ASN
.........................................
Program Listing:
DirectoryName: MAZe
CheckSum: # 7D15h
Size: 7276
%%HP: T(3)A(D)F(.);
DIR
Start
\<<
"Amazing Program
originally found in
BASIC Computer Games
Edited by David H. Ahl
Workman Publishing CR 1978
Conversion From BASIC to RPL
by TinyWanda
Wnd...@aol.com"
DROP .2 WAIT KEY
\<< DROP
"Enter Width & Height
Of The Maze? "
{ ":W:
:H: " { 1 5
} V } INPUT OBJ\->
\>> IFT DUP2
DUP2 * 2 * 3 ROLLD
2 \->LIST 0 CON DUP 0
0 RAND 8 PICK *
CEIL DUP 2 1
"Amazing Maze
" 12
PICK DTAG " By " 14
PICK DTAG "
" + +
+ + 13 CHR 10 CHR +
RCLF { h v \162 W V q
z x r c s $ \|v f }
\->Sto STD 1 h
FOR i '$' i x
== ". " ".--" IFTE
STO+
NEXT '$' "."
\|v + STO+ 'W' x 1 2
\->LIST 1 PUT CLLCD
" Calculating Maze"
1 DISP 1
WHILE DUP
REPEAT
'Lines' SWAP " "
OVER + 5 DISP GET
EVAL
END DROP
CLLCD
" Drawing Maze" 1
DISP h v * 2 * '\162'
STO 1 v
FOR j '$' "I"
STO+ 1 h
FOR i V { i
j } GET 2 <
\<< '$'
" I" STO+
\>>
\<< '$'
" " STO+
\>> IFTE ?
NEXT '$' \|v
STO+ 1 h
FOR i { 0 2
} 'V' { i j } GET
POS
\<< '$'
":--" STO+
\>>
\<< '$'
": " STO+
\>> IFTE ?
NEXT '$'
":" \|v + STO+
NEXT $ "\->"
'\->\183' INCR Abc +
OBJ\-> STO f STOF { h
v \162 W V x r c s $ \|v
q z f } PURGE :&:
Alrm EVAL
\>>
\->\183 0
\->Sto
\<< DUP TYPE RCLF
\<< PICT RCL
LCD\-> NEG PICT STO {
# 0d # 0d } PVIEW
RAND 2000 * 500 +
.05 BEEP TEXT PICT
STO
\>> \-> $ \164 \GD
\<< -55 -56 CF
CF
CASE $ NOT
THEN
IFERR
OVER TYPE 12 ==
THEN 0
END
\<< 1
FOR \162
DUP TYPE 12 ==
\<< OBJ\->
IFERR OBJ\-> STO
THEN \->TAG \162 ROLLD
END
\>>
\<< \162 ROLLD
\>> IFTE -1
STEP
\>>
\<< "\183"
OVER + OBJ\-> STO
\>> IFTE
END $ 5
==
THEN DUP
SIZE 1
FOR \162
SWAP OVER \162 GET STO
-1
STEP
DROP
END { 6 7
} $ POS
THEN 1
DO 1 +
DUP PICK TYPE { 6 7
} SWAP POS NOT
UNTIL
END 1 -
2
FOR \162 \162
ROLL SWAP STO -1
STEP
END $ 12
==
THEN OBJ\->
IFERR
OBJ\-> STO
THEN
\->TAG \GD EVAL
END
END \GD
EVAL
END \164 STOF
\>>
\>>
Abc
\<< ""
WHILE OVER 26
>
REPEAT OVER
26 SWAP 1 - SWAP
MOD 1 + DUP 64 +
CHR EVAL ROT + 3
ROLLD - 26 / SWAP
END SWAP 64 +
CHR EVAL SWAP +
\>>
Cba
\<< DUP SIZE \-> \162
\<< 0 1 \162
FOR $ OVER
$ $ SUB NUM 64 - 26
\162 $ - ^ * +
NEXT SWAP
DROP
\>>
\>>
?
\<< " " '\162' DECR
+ 3 DISP
\>>
Alrm
\<< -56 CF DEPTH
\->LIST RAND 6 * 2 +
CEIL \-> h y
\<<
IFERR { } 1
y
START
RAND 4400 * + RAND
+
NEXT 1 8
START DUP
EVAL 1 y
START
BEEP
NEXT
NEXT
THEN
END CLEAR h
OBJ\-> DROP -56 SF
\>>
\>>
Lines {
\<< 8
\>>
\<< r h \=/ 6 3
IFTE
\>>
\<< s v \=/ 5 4
IFTE
\>>
\<< 1 { r s } STO
7
\>>
\<< 1 'r' STO 's'
1 STO+ 7
\>>
\<< 'r' 1 STO+ 7
\>>
\<< 'W' { r s }
GET 0 == 2 8 IFTE
\>>
\<< r 1 - 0 == 41
9 IFTE
\>>
\<< 'W' { 'r-1' s
} GET 0 \=/ 41 10
IFTE
\>>
\<< s 1 - 0 == 24
11 IFTE
\>>
\<< 'W' { r 's-1'
} GET 0 \=/ 24 12
IFTE
\>>
\<< r h == 16 13
IFTE
\>>
\<< 'W' { 'r+1' s
} GET 0 \=/ 16 14
IFTE
\>>
\<< RAND 3 * CEIL
'x' STO 15
\>>
\<< { 75 79 83 }
x GET
\>>
\<< s v \=/ 19 17
IFTE
\>>
\<< z 1 == 22 18
IFTE
\>>
\<< 1 'q' STO 20
\>>
\<< 'W' { r 's+1'
} GET 0 \=/ 22 20
IFTE
\>>
\<< RAND 3 * CEIL
'x' STO 21
\>>
\<< { 75 79 90 }
x GET
\>>
\<< RAND 2 * CEIL
'x' STO 23
\>>
\<< { 75 79 } x
GET
\>>
\<< r h == 34 25
IFTE
\>>
\<< 'W' { 'r+1' s
} GET 0 \=/ 34 26
IFTE
\>>
\<< s v \=/ 29 27
IFTE
\>>
\<< z 1 == 32 28
IFTE
\>>
\<< 1 'q' STO 30
\>>
\<< 'W' { r 's+1'
} GET 0 \=/ 32 30
IFTE
\>>
\<< RAND 3 * CEIL
'x' STO 31
\>>
\<< { 75 83 90 }
x GET
\>>
\<< RAND 2 * CEIL
'x' STO 33
\>>
\<< { 75 83 } x
GET
\>>
\<< s v \=/ 37 35
IFTE
\>>
\<< z 1 == 40 36
IFTE
\>>
\<< 1 'q' STO 38
\>>
\<< 'W' { r 's+1'
} GET 0 \=/ 40 38
IFTE
\>>
\<< RAND 2 * CEIL
'x' STO 39
\>>
\<< { 75 90 } x
GET
\>>
\<< 75
\>>
\<< s 1 - 0 == 60
42 IFTE
\>>
\<< 'W' { r 's-1'
} GET 0 \=/ 60 43
IFTE
\>>
\<< r h == 53 44
IFTE
\>>
\<< 'W' { 'r+1' s
} GET 0 \=/ 53 45
IFTE
\>>
\<< s v \=/ 48 46
IFTE
\>>
\<< z 1 == 51 47
IFTE
\>>
\<< 1 'q' STO 49
\>>
\<< 'W' { r 's+1'
} GET 0 \=/ 51 49
IFTE
\>>
\<< RAND 3 * CEIL
'x' STO 50
\>>
\<< { 79 83 90 }
x GET
\>>
\<< RAND 2 * CEIL
'x' STO 52
\>>
\<< { 79 83 } x
GET
\>>
\<< s v \=/ 56 54
IFTE
\>>
\<< z 1 == 59 55
IFTE
\>>
\<< 1 'q' STO 57
\>>
\<< 'W' { r 's+1'
} GET 0 \=/ 59 57
IFTE
\>>
\<< RAND 2 * CEIL
'x' STO 58
\>>
\<< { 79 90 } x
GET
\>>
\<< 79
\>>
\<< r h == 69 61
IFTE
\>>
\<< 'W' { 'r+1' s
} GET 0 \=/ 69 62
IFTE
\>>
\<< s v \=/ 65 63
IFTE
\>>
\<< z 1 == 68 64
IFTE
\>>
\<< 1 'q' STO 80
\>>
\<< 'W' { r 's+1'
} GET 0 \=/ 68 66
IFTE
\>>
\<< RAND 2 * CEIL
'x' STO 67
\>>
\<< { 83 90 } x
GET
\>>
\<< 83
\>>
\<< s v \=/ 72 70
IFTE
\>>
\<< z 1 == 74 71
IFTE
\>>
\<< 1 'q' STO 73
\>>
\<< 'W' { r 's+1'
} GET 0 \=/ 74 73
IFTE
\>>
\<< 90
\>>
\<< 100
\>>
\<< 'W' { 'r-1' s
} c PUT ? 76
\>>
\<< 'c' 1 STO+
'V' { 'r-1' s } 2
PUT ? 'r' 1 STO- 77
\>>
\<< h v * 1 + c
== 0 78 IFTE
\>>
\<< 0 'q' STO 8
\>>
\<< 'W' { r 's-1'
} c PUT ? 80
\>>
\<< 'c' 1 STO+ 81
\>>
\<< 'V' { r 's-1'
} 1 PUT ? 's' 1
STO- h v * 1 + c ==
0 82 IFTE
\>>
\<< 0 'q' STO 8
\>>
\<< 'W' { 'r+1' s
} c PUT ? 84
\>>
\<< 'c' 1 STO+
'V' { r s } GET 0
== 86 85 IFTE
\>>
\<< 'V' { r s } 3
PUT ? 87
\>>
\<< 'V' { r s } 2
PUT ? 87
\>>
\<< 'r' 1 STO+ 88
\>>
\<< h v * 1 + c
== 0 89 IFTE
\>>
\<< 41
\>>
\<< q 1 == 96 91
IFTE
\>>
\<< 'W' { r 's+1'
} c PUT ? 'c' 1
STO+ 'V' { r s }
GET 0 == 93 92 IFTE
\>>
\<< 'V' { r s } 3
PUT ? 94
\>>
\<< 'V' { r s } 1
PUT ? 94
\>>
\<< 's' 1 STO+ h
v * 1 + c == 0 95
IFTE
\>>
\<< 8
\>>
\<< 1 'z' STO 97
\>>
\<< 'V' { r s }
GET 0 == 99 98 IFTE
\>>
\<< 'V' { r s } 3
PUT ? 0 'q' STO 100
\>>
\<< 'V' { r s } 1
PUT ? 0 'q' STO 1 {
r s } STO 7
\>>
\<< 2
\>> }
END
-[ TERMINUS ]-
empty isn't it.
Bellal - yaq...@coventry.ac.uk
WndaLouise wrote: > .--.--.--.--.--.--.--. .--.--.--.--.--.--.--. > I I I I I I > : :--: :--:--:--:--: :--: : : : : : : > I I I I I I I I > :--: :--: : :--:--:--: :--:--:--: : : : > I I I I I I I I I > :--:--: :--: :--: : :--:--: : : : : : > I I I I I I I I > : :--:--: :--: : :--: :--:--: : :--:--: > I I I I I I I I I > :--:--:--:--: :--:--: :--: :--: : : : : > I I I I I I I I I > : : : :--: : : :--: :--: : :--:--: : > I I I I I I I I I I I > : : :--: : : :--: :--:--:--:--: : : : > I I I I I I I I > :--:--: :--:--:--: :--: :--:--: : :--:--: > I I I I I I I I I > : : :--: : : :--:--:--: : : : : : : > I I I I I I I I I I I > : : : :--:-- :--: : :--: What's with the above line? > I I I I I I I I I I > : :--:--: : :--:--:--:--: : : :--:--: : > I I I I I I I I I I > : :--: : :--: : : : :--:--: : : : : > I I I I I I I I I I I I > : : :--: : :--: :--:--: : : : :--: : > I I I I I I I I I > : : :--: :--: :--:--:--:--: :--: : : : > I I I I I I I I > : :--: :--:--:--: :--:--: :--: :--:--:--: > I I I I I I I > : : :--:--:--:--: : :--:--: : :--:--: : > I I I I I I I I I I > : :--: : : : :--: : :--: :--: : :--: > I I I I I I I I I I > : :--:--: : : : :--:--: :--: :--:--: : > I I I I I I I I I I > : : : :--: : : : : : :--:--: : :--: > I I I I I I I I I I I > : :--:--: : : : : :--: :--:--:--: : : > I I I I I I I I I I > :--:--: :--:--: :--: : : : :--: : : : > I I I I I I I I I I I > : :--:--: :--: : :--: : : : :--: : : > I I I I I I I I I I > :--:--: : : : :--:--:--:--: : : : : : > I I I I I I I I I I I > : : : :--: : :--: : : : :--: : :--: > I I I I I I I > :--:--:--:--:--:--:--:--:--:--:--: :--:--:--: Umm.... Try for something smoother, like: (Note that in my mazes the start is the door and the end is the X or O. ,-----------------------------.----------------------------------. | | | | . . ,--------- | ------------------------. | | | | | | | | | | `----"--------------' ,-------------------. | | | | | | | | | :--------------.--------------"---- ,---------: | | | | | | | | | | :--------- | . ,---------. | . | `----: | | | | | | | | | | | | ---------' | :---- | | | | . | | | | | | | | | | | | `-------------------' | ----' | | | | | | | | | | | | :--------------.---------. :--------------' | :----' | | | | | | | | | . . | . | | ,--------------: `---- | | | | | | | | | | | | | | " | | | | ---------"---------. | | | | | | | | | | | | `---------"----' | | ,---------. . | | | | | | | | | | | | :---------.--------------: | | . | | | | | | | X | | | | | | | | | " . `--------- | | `----' | `----' | | | | | | | `---------"-------------------' `--------------"--------------' Of course, my hp48 knowlege is _very_ near 0........ I've added your rendering method to my generator: :--:--:--:--:--:--:--:--:--:--:--:--:--:--:--: I I I I : :--: :--:--:--:--:--: : :--:--: : : : I I I I I I I I I I I : : : : :--: : :--: :--:--: : : : : I I I I I I I I I I : : : :--:--:--:--:--:--:--: : : : : : I I I I I I I I I : : :--:--:--:--:--:--:--: : : :--: : : I I I I I I I : : : :--:--:--: :--:--:--: :--:--:--: : I I I I I I I : : : : : :--:--:--:--:--:--:--:--:--: : I I I I I I I :--: : :--: : : :--:--:--: : :--:--:--: I I I I I I I I : : :--: :--:--:--:--:--: : :--:--:--: : I I I I I I I I I : : : :--:--:--:--:--: : : : :--: : : I I I I I I I I I OI I I : : : : : :--: : : : : : : : : : I I I I I I I I I I I I I I I : :--: :--: : : : : : : : : : : : I I I I I I I I I I I : :--:--:--:--:--: :--:--:--: : : : : : I I I I I I I :--:--:--:--:--: : : :--:--:--:--:--: : : I I I I I I I I : :--: :--:--: : : : : :--:--:--:--: : I I I I I :--:--:--:--:--:--:--: :--:--:--:--:--:--:--: Here's a smoother version at the same size as yours: ,--------------------.-----------.-----------. | | | | | . . ,-------- | --. . `-------- | | | | | | | | | | | :--"-----------: ,--: `--------------: | | | | | | | | | | ,--------. " | `--.-----------. | | | | | X| | | | | | | | | ,-----"-----' --' -----. | | | | | | | | | | :--' | | | ,--.-----.--------------' | | | | | | | | | | | :-- | | | | " . | ,-- ,--------' | | | | | | | | | | | | . | | | `-----' | :--. | ,-----. | | | | | | | | | | | | | | :--' | `--------. | | | | | . " | | | | | | | | | | | | | | ,--"--------. | | | | | `--"-----: | | | | | | | | | | | | | ,----- " | | | | :--------. | | | | | | | | | | | | | " | `-----------' | | | | . ,--' | | | | | | | | | | :--. | ,--.-----------' | " `--' | . | | | | | | | | | | | " | " | ,--. ,-----"-----------: `--: | | | | | | | | | --"-----' | " | ,----- ,-- `-- | | | | | | | `--------------"-----' `--------"-----------' See ya! :-) -- --ran...@slip.net (Randy Gardner) --http://www.slip.net/~randyg/index.htm - *New* Download a maze program that lets you actually walk *inside* the maze!! Note that the version up for download does not have the ASCII output added yet. Yes, I know.....
I'm sure I'd find this interesting if I had an HP48s/g. However, this is
an _ASCII art_ newsgroup, and the only ASCII art in this is a maze. Yes,
it uses ASCII, but this is an ASCII _ART_ newsgroup. Try posting this to
alt.comp.hp48 or alt.comp.hp48.d .
--
thank you for reading my babbling
__ __ o
please remove *remove me* / \/\/ \/
from my e-mail address \__/\/\__/\o
. . . . . . . . . . . . . . /\ . ./\ rdv
aka Turret __ __
___ ____ ________/ / _____ _____/ /_____
/ _ `/ _ `/ __/ _ / |/ / _ `/ __/ '_/ _ \
\_,_/\_,_/_/ \_,_/|___/\_,_/_/ /_/\_\\___/
http://www.geocities.com/SiliconValley/Lab/2672/index.html
BobCode: K l E m6 C B-x O L S+++ T A H b8 D2
to receive instructions for converting text into ascii
art letters, e-mail me with figlet in the subject line
SPAM FOOD tos...@aol.com tos...@aol.com tos...@aol.com
tos...@aol.com web...@juno.com web...@aol.com
web...@bigfoot.com abu...@bigfoot.com
WndaLouise wrote in message
<199...@ladder02.news.aol.com>...
[schnip]
About this thread.
These messages were posted publicly to the newsgroup
alt.ascii-art
in 1998 and are mirrored here unchanged as part of the Historic Archives – only email addresses are masked.
The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can.
Are you one of the authors? Contact us to get your posts attributed, connected to your artist profile, or removed.