Fun task: write a program which takes such output, identifies all enclosed cells, and breaks them open, so that the maze is connected: any two points in the maze are connected by at least one path.
Bonus: close loops, so any two places in the maze are connected by a unique path.
As a preprocessing step, reformat the data to 77-column-long lines first, removing any whitespace characters, and discarding the last line if it is shorter than 79 characters, and then close off the exterior with solid zig-zags, like this, which are strictly added to the data (no overwriting):
Gordon Bennett! That certainly provides a stark reminder of how slow BASIC was on the Commodore 64.
This rings a bell though: I remember encountering it back when I owned the machine, possibly in the BASIC manual that came with it, possibly in a magazine, or perhaps somebody at school mentioned it.
Love it! Brings up so much nostalgia from the days of programming on my old TRS-80. But is it really a maze? Once you start, you don't seem to get much choice of path...
My maze generator at http://tromp.github.io/pearls.html#maze produces arbitrarily long proper mazes on the fly. After compiling and running, enter -1 as the requested height.
For anyone not familiar with the TRS-80, who finds the code somewhat weird.. the BASIC implementation was written by Microsoft. Only the first two letters of variable names were significant. Although interpreted, the ROM tokenized typed lines, meaning it didn't care about spaces.
Wow! Can you share your story more? What does your application do? Why did you choose BASIC 35 years ago? Did the question about rewriting it another language come up anytime? How did such discussions go? Do you enjoy writing BASIC code?
I've been with the company 20 years so wasn't involved in the original decision. I believe the company started out on PDP's before moving to MicroVAX (and later Alpha and Integrity). BASIC will likely have been the best fit at the time.
It is business software for the Agri industry, originally a terminal text entry system. Now we also have a web front end (running on Windows IIS, communicating to VMS/BASIC via Apache Tomcat/WSIT webservices).
We did try converting to VB6 back when it was a thing, but then .NET happened so we abandoned it as conversion to VB.NET wasn't so straight forward. A rewrite in C# was briefly considered before finally going for the web front end/web services option to avoid rewriting the BASIC business/data layer.
Sadly the application will go end of life in a couple of years, as we're now part of a larger corporation who have similar applications. Ours lost out due to the OpenVMS layer being a hard sell to new customers.
I've never really thought about when I enjoy it! It's mostly a data entry / reporting application, so generally not very exciting :)
It bothers me way more than it should that this line of code has become known as "10print". Like, 95% of BASIC oneliners out there start with "10 PRINT". It's like calling a McDonald's Super Size Big Tasty Meal With Diet Coke And A Side Salad a "Mac".
It should've been called 205.5+RND or something. Grmbl.
RND(1) returns a value between 0 and 1, but always lower than 1. Thus, the result of 205+RND(1) will always be 205 point something, which in turn will be truncated to 205. Thus, it will always result in the same character.
It's more that the decimal is always rounded down. So you don't want a value between 205 and 205.9999999, as it'll always be rounded down to 205. you want a value between 205.5 and 206.49999999, so when rounded down it has a (practically) even chance of landing on either 205 or 206.
Nice. This brings back some great memories. I used to do a similar one-liner that alternated between white and black blocks, which created crossword-puzzle-like patterns. I'd sit across the room and squint at the display, hoping to see some sort of emergent pattern.
61 comments
[ 0.27 ms ] story [ 147 ms ] thread2012: https://news.ycombinator.com/item?id=4856207
Not that that helps in any way, since you never know which font might be used^^
Source: http://10print.art/__repl
for(){Write-Host(Random("\","/"))-N}
while true; do printf "\u$((2571 + ($RANDOM & 1)))"; sleep 0.02; done
Bonus: close loops, so any two places in the maze are connected by a unique path.
As a preprocessing step, reformat the data to 77-column-long lines first, removing any whitespace characters, and discarding the last line if it is shorter than 79 characters, and then close off the exterior with solid zig-zags, like this, which are strictly added to the data (no overwriting):
This rings a bell though: I remember encountering it back when I owned the machine, possibly in the BASIC manual that came with it, possibly in a magazine, or perhaps somebody at school mentioned it.
https://floooh.github.io/tiny8bit/c64.html?input=${wait:200}...
It's a (neat) graphic trick.
https://www.youtube.com/watch?v=lWyZO-yPnvM
For anyone not familiar with the TRS-80, who finds the code somewhat weird.. the BASIC implementation was written by Microsoft. Only the first two letters of variable names were significant. Although interpreted, the ROM tokenized typed lines, meaning it didn't care about spaces.
This led to such gems as:
FORK=10 TOMATOES STEP LADDER
Providing a neg number to RND would "reseed" the random number generator. TI was a "system" variable that updates every 60th of a second.
It should've been called 205.5+RND or something. Grmbl.
205 + RND(1) would always evaluate to 205 when truncated.
205.5 + RND(1) pseudo randomly selects between 205 and 206
https://www.youtube.com/watch?v=wh7gRoYgUpc
1A$="[up][down][left][right]":PRINTMID$(A$,RND(.5)4+1,1)"[left]";:FORI=1TO30:NEXT:PRINT"[rvson][space][left]";:GOTO1
And a fun curvy variation:
https://jsfiddle.net/qxjdtru6/1/