Hacker News new | past | comments | ask | show | jobs | submit login
Lemonade Stand (possiblywrong.wordpress.com)
129 points by elvis70 on March 13, 2024 | hide | past | favorite | 42 comments



The first software I made that had users other than myself was a Lemonade Stand clone for the TI-83 Plus. I shared it with people at my school using a link cable and, as there wasn't much competition in the calculator game market, it was a big hit. The next school year, I attended a drivers ed class at our crosstown rival high school and found that my game had somehow spread to that school as well! I have no idea how it happened, but it was very satisfying seeing something I made have a life of its own. Ben Brode was on the Search Engine podcast recently and shared a very similar story.[1] I wonder how many other programmers of our generation had this experience.

One thing that my game had that the original did not (and I don't know if I invented this or copied it from the version I played) was a hidden demand parameter that persisted between days. Advertising and word of mouth from satisfied customers would cause it increase, while customers going away empty-handed would cause it to decrease. That turned the game into a kind of clicker where the numbers could continue to go up and up. I also added the ability to save your game by serializing the game state to an image file, since that was the only way to save data on the TI-83 Plus that wasn't likely to be clobbered by another program.

1. https://pjvogt.substack.com/p/how-do-you-make-an-addictive-v...


In highschool my statistics teacher got me to key my Snake game into her graphing calculator instead of having to do the lesson, lol.


My 9th grade social studies teacher had me fix his computer instead of taking the class final ("You already earned an A+ in my class, help me get the gradebook working so we can all go home").


I didn’t see my games/programs get spread like that exactly but I got my start on the TI-84+ SE and spent a ton of time on ticalc (can’t remember if it was .com or .org) forums and uploaded programs and games to their archives.

I wore the buttons off my calculator and did 90%+ of my programming on it (only used the desktop app to write and push code to the calculator near the end of my time using it). Then I took a HS class on Java, taught myself PHP, and never really looked back to my calculator. TI-BASIC was a great start but so limiting once I discovered other languages.


In high school, my trig teacher was not only a phenomenal instructor who would patiently explain and answer questions until every last student fully grasped the concepts, but also, it turns out, proved to be a big enabler of my interest in programming. Instead of spending time working out the problems, I would spend that time every day writing a TI-BASIC program which would implement the algorithms we had just been taught and output not just the answer, but "shown work" as well. It was obvious to him that if I could write the product requirements for such a program and then implement it, I understood the material as well as someone who was solving by hand, so he fully blessed it. And I discovered that I definitely enjoyed programming (and even thinking up clever 'UI' design for my programs) more than solving math problems, although I did 'accidentally' learn to do that too along the way.

I don't know if I would have been as confident to try programming later if I hadn't had that experience with TI-BASIC (indeed, a truly limiting language!).


That’s so funny, I had the exact same experience. It felt like cheating, I’d write programs to solve each step and show the work and my teacher said almost the same thing. That if I could write a program to do it then it meant I understood the core concept and that was fine.

I had a solver program where you’d pick the “style” of the math program (like “4x + 2 = 12” or similar) then be asked to plug in the “4”, “2”, and “12” from the previous example and it would solve for “x”.


Nice. It would be really funny if we'd both had the same teacher :D


If math was taught this way I would have learned much advanced math by now. I could totally dig into it this way.


Still going strong! https://www.ticalc.org/


>found that my game had somehow spread to that school as well ... I wonder how many other programmers of our generation had this experience.

Similarly, my little brother inherited my Ti-83+ and spread all the personal software I had written to his entire class: a simple kinematics solver (byebye thinking about intro physics homework), blackjack/21 (Vegas dealer rules, no splits), and several chemistry homework utilities.

Needless to say, teachers were not impressed with my/his cleverness.


I got started with a TI-85, writing math solvers and a Drug Wars clone. Did share with a link cable but never had the joy of discovering such vitality as yours!


The interesting variation discovered on the Internet Archive copy of the game looks an awful lot like maybe some kid back in the day was poking around on the computer at school trying to cheat at lemonade stand or something. And that just happens to be the floppy that was later archived and became the most widely distributed copy ever. God, I hope it wasn’t me.

So my new thought: is this a good game hack? I think if it were being played competitively in a classroom, as this game commonly was, it could give someone with knowledge of its behavior an advantage. I wonder if there is more to the story!


This reminds me of playing around on my school's Apple II clone at a textmode "Stock Market" game. Once I realized it was a BASIC program, I started updating the names of the companies for the lulz, and screwing around with the game mechanics!


The Prisoner 2 for the Apple ][ had a scene where you're at the psychiatrist in the hospital, and they give you a psychological test, and in the middle of it, the game pretends to break into AppleSoft with an error at the line number of your secret resignation code, and it tries to trick you into entering your secret number like "LIST <number>":

https://en.wikipedia.org/wiki/The_Prisoner_(video_game)#Game...

>The game continually tries to trick the player into revealing the secret three-digit code. One of the most nefarious attempts (which occurs in Prisoner 2) is a simulated game crash that includes the error message "Syntax error in line ###", where the line number is the player's resignation code. This was a common error message in the Apple II's BASIC programming language, and the logical step for users of the time would be to review the erroneous line of code with the command "List ###" (again substituting the specific number in question). Typing the secret three-digit code at any time resulted in the game being lost, however, and that included typing such a BASIC command since, unknown to the player, the game was actually still running. Ironically, being able to list the program's code from within it was one way to solve and win the game by means of analyzing the program and deducing a solution. Yet such a solution was entirely within the spirit of the game, as its clues sometimes broke the fourth wall with an acknowledgement that a computer game was being played.

https://mocagh.org/miscgame/prisoner-alt-manual.pdf

<6>. If you think the program isn't working, try again. What you may at first believe to be an error may not be the case. A trick might be played on you; certain possessions must be gained or tasks performed to get something to work, or the computer may be waiting for you to press certain keys or make certain responses. Don't be too quick to assume an error, and remember that <CTRL C> can get you out of any section of the program. If you do discover an error of any kind, read the Warranty.


There were two cassette-tape programs that shipped with the Apple ][ that arrived in our school. Lemonade Stand and The Great American Probability Machine.

https://whatifmath.org/the-great-american-probability-machin...

This was the old fun, quirky 1970s Apple Computer, Inc. I still fondly remember.


I’ve been trying to find info on the actual game, but all I can find are biographical stories like this one. It sounds interesting by the name! I just wish I could find more info about the game itself


It was distributed on cassette tape at first. Years later it was archived on disk in the "Apple Software Bank, Volume 5"

https://mirrors.apple2.org.za/ftp.apple.asimov.net/documenta...

There's a disk image of it on Archive.org, but the program was written in Integer Basic and the MAME emulator here boots into //e mode. You'll get a LANGUGAGE NOT AVAILABLE error when trying to run it from an Applesoft prompt. Does anyone know how to change the core machine? Is Jason around?

https://archive.org/details/riag_005_Volume_042_-_Apple_Soft...


Seems like it's some simulation of Pascal's Triangle with a Pachinko feel?

I'd like to know more too!

https://www.digibarn.com/collections/software/apple2/apple2e...


Yes, it's totally Pascal's Triangle. Or, if were born after 1980, Plinko.

Okay here's the steps. Took me 40 years to remember how to do this!

0) Go to archive.org here

https://archive.org/download/riag_005_Volume_042_-_Apple_Sof...

1) Save the file "Volume_042_Apple_Software_Bank_5.dsk" locally

2) Run the Apple ][ emulator from here. This will also load the DOS 3.3 disk with Integer BASIC on it:

https://www.scullinsteel.com/apple2/#dos33master|

3) For disk 2, press the folder button, choose the "Local Saves", "Choose File", then load the .dsk file.

4) Then do these commands:

    INT
    LOAD GREAT AMERICAN PROB. MACHINE,D2
    RUN
Enjoy.

PS: LEMONADE is also possible with these same steps, use this disk image:

https://archive.org/download/a2_Lemonade_Stand_1979_Apple/Le...

And then these commands

    FP
    RUN LEMONADE,D2


The original Apple Vision before it went Pro:

https://www.youtube.com/watch?v=RiWE-aO-cyU


> I don’t know where these changes came from. And I believe these are indeed changes from the original release...

Well, our copy at school was on a 5.25" floppy, with a sticker over the write-protection, so we'd regularly take the sticker off, change the code, save the file, and put the sticker back. We didn't really know what we were doing, but finding arithmetic in code and changing it was not beyond the ability of a clever 6th grader.

So if people were getting the source from old floppies... changes could have come from kids like me who did not realize how obnoxious our decisions were are that point in our lives.


The version I played on the ][+ was clearly not the one shown here, it didn't use a rng. The weather/event sequence was the same every time.


It may have been that they used a PRNG and gave it the same initial seed each time.

There were all sorts of odd bits of programming in a lot of these early BASIC games; they were often done by self-taught programmers.


Yeah, my first game I ever wrote was a dog racing game in BASIC when I was 9. I didn’t understand PRNG at all or anything about seeds, but I did notice that the same dog won the same race in order.

My solution? At game launch, the game would print “hit space to start the game and then run a right loop over a ‘rand’ call until the user hit space. The entropy was in how long it took you to hit the spacebar!


I remember this being the recommended way to get random numbers in some programming magazine or textbook, in a BASIC without built-in RAND(). Amazing work to discover this yourself at age 9!

And if you squint, using mouse movements as a source of entropy is still used by some modern programs. Some SSH key generators use it, and I'm sure I've had a Linux installer ask me for it too in recent years. I'm not sure whether this is theatre or whether the OS really can't be relied on to provide suitable entropy itself.


I think old console games (e.g. for the NES) were like this. You can record the inputs for a speedrun dependant on RNG and replay them on a real console, and so long as the timing is maintained exactly, the RNG outputs will be the same. This has been demonstrated with a tool called TASbot.


I don't think TASbot is a real tool, it's an avatar for any tool assisted speed run using a variety of tools unique to a specific system or game. See https://tas.bot/wiki/Main_Page


A little of column A, a little of column B.

Generally a key generator does not itself watch for mouse-movements, it just gets random noise from the OS. But the OS gets its random noise from a random number generator, and the random number generator needs to be seeded with genuine randomness. Some CPUs provide a hardware RNG, but older CPUs do not, and some OSs do not trust a hardware RNG implemented in opaque, un-auditable microcode, so they get their randomness from things like the difference between the CPU clock and real-time clock[1] or the relative timing of interrupts... such as those caused by mouse-movement or keyboard key presses.

[1]: https://www.finnie.org/software/twuewand/


Yeah, sometimes I am surprised by what I was able to figure out as a kid, with no internet or anyone to really ask how to do things. I had books, but mostly just figured stuff out.

I recreated bastardized versions of so many data types that I learned about much later.


Now that I think of it, the computer didn't have a clock, didn't really have any source of entropy. So yeah, that's probably right.


There were memory mapped devices from which you could almost certainly squeeze some out so 'any' is maybe slightly overstated.


Depends on the system. With only one clock source, and no analog input, everything except for user input and disk access time would be completely deterministic.

Not an Apple II expert, but the original IBM PC used a single 14.318MHz crystal to derive every other clock.


There were analog inputs though -- the joystick ports, which were equipped for pong-style potentiometer paddles.


I enjoyed this game! I have the ][ and played it on the "The Apple At Play" [1] disk (both are in the closet right behind me.) I think it actually might have been a different version than the one you have.

I made a handful of GPT "games" a couple of months ago, one of which was a Lemonade Stand clone. Can try it out at [2].

It does some interesting things around rolling random numbers in Python for the weather and it's nice that you can put in free-form text to say what you want to do for your actions. It's definitely more hackable than the original (good prompt security test.)

[1]: https://archive.org/details/3d0g_059b_Apple_at_Play [2]: https://chat.openai.com/g/g-e7DwANYTS-lemonade-stand


I loved that game when we got to play it at school as a kid. It was the first thing that made me think about supply and demand.


I think we played a later version in school and it really imprinted the concept in my brain. Also think the RNG didn’t let probability go below a certain point in that version, remember charging $1000 for a glass of lemonade and making a sale.


Yeah, I remember in 5th grade we had a day where each kid got a turn on the classroom computer to see how far they could go.


This reminded me of a similar game that I played a lot during the university (on my palm pilot). Dope wars.

https://archive.org/details/palm3_DopeWars2.4.6

It seems to be a copy of Drug Wars for DOS

https://archive.org/details/msdos_Drug_Wars_1984

It was very entertaining.


How times have changed. At the time, I would also have been into reverse engineering it.

Today I think I should make an RNN to solve it, and how fast I can get Applesoft BASIC to run for training.


Legendary game for its time. Because computers weren’t common at home by us, the word of this game would get around and you’d be rather grateful when you had an opportunity to play it. It was novel for the time.


This reminds me of Millionaire for the ZX Spectrum. It was also written in BASIC and hence easy to modify.

https://en.wikipedia.org/wiki/Millionaire_%28video_game%29


Well shit there's something I haven't thought of in over 35 years...




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: