Pig for Palm PDA
Don't get greedy
This week theis doing PDA week and I thought I would join in the fun by jumping ahead a few years from my Atari topics to talk about the Palm PDA, a great early PDA (Personal Data Assistant) from the late 90s and early 2000s.
I remember I got my first Palm (the Palm III) in 1999, shortly after we bought our first house. What is a Palm you ask? Well, it was a small handheld computer, the first one that was actually popular. Sure, the Apple Newton was probably a better overall product, but it was much more expensive, bigger and not nearly as practical for most people.
The Palm was smaller than an iPad mini, but bigger than an iPhone. It used a stylus with its touch screen and unlike the Newton which had handwriting recognition, the Palm used something called “Graffiti” which was essentially a set of standardized scribbles for each letter, number or punctuation. You could write one character at a time in the special stylus area and it would be displayed onscreen appropriately, assuming you did it right.
Initially the Palm only had a black and white screen and had no network connectivity, but color and network access (wifi) would be added in later versions. The Palm IIIc, the first color version, was probably my favorite overall. It would “sync” with your computer (PC or Mac) using its serial or USB port. This is how you would transfer data or apps to/from it.
You could often find me in meetings with my Palm III and a portable keyboard stand (the GoType), diligently taking notes!
Speaking of apps, Palm did not have any sort of official app store. Although there were some 3rd party stores that let you download apps (to a computer to install on the Palm manually), anyone could make an app and install it on the Palm. In 2000 I picked up something called NSBASIC/Palm, which was a BASIC IDE that ran on Windows for making Palm apps. The NS in its name apparently stands for “Nice and Smart”.
One of the most substantial things I made with it was a game called Pig. This is a dice game also known as Greedy and probably other names.
The game is played with two dice. You roll the dice adding up the score of each roll. But the trick is that your first roll is the “avoid” score. If you roll that value again, you lose all your points. You can stop at any time and keep the points you have.
So the idea is to maximize your points, but not get too greedy so that you end up with nothing. It’s a fun, simple game that I played with my family a lot as a kid.
With NS/BASIC I built a digital version of the game to play on the go. It supported four players with some computer opponents.
I even submitted it to the 2nd NSBASIC programming contest back in 2001. It didn’t win, but it is mentioned on the contest page, which is still available.
Pig by Paul Lefebvre Pig is a dice game. The source is included. It provides good examples for how to handle menus, screen objects (buttons and text), databases and processing. Its code is very structured and has strict formatting and naming standards which along with the comments should make it very easy to understand.
You can download Pig from here, with full source code.
If you want to give Pig a try, there is an online Palm emulator called CloudPilot and it can run Pig.
Here is a snippet of the Pig source:
function play() as integer dim li_dice as integer dim li_max_roll as integer dim li_total as integer dim li_adjust_roll as integer ' Computer play algorithm gi_roll = 1 li_dice = roll_dice() delay 0.5 li_max_roll = gi_max_roll(li_dice) do while gi_roll <= li_max_roll gi_roll = gi_roll + 1 li_dice = roll_dice() delay 0.5 if li_dice > 0 then li_total = li_total + li_dice li_adjust_roll = gi_adjust_roll(li_dice) if gi_roll < 5 then li_adjust_roll = 0 li_max_roll = li_max_roll + li_adjust_roll else li_max_roll = -1 end if loop if li_max_roll > 0 then call pass( 1 ) end if play = li_max_roll end function
I didn’t end up using NSBASIC for much else. Shortly after this I switched to Mac and ended up using Realbasic (now Xojo) for programming. I probably should port Pig over to that, at least so I have an iOS and Android versions! The Palm died off in the late 2000s, with the OS being used above dying even earlier than that. NS/BASIC lives on today as App Studio.
Join the free mailing list to be notified as soon as posts are published.
Goto 10 is currently having a Year-End Sale. Save 20%on yearly subscriptions to get access to extra posts and perks.
Where I currently work. Xojo is great BASIC-like development environment for making apps for Mac, Windows, Linux, Web, iOS and Android. It can’t make Palm apps, though.
I used to work at Palm. I started there shortly after 3Com bought them and stayed there until Jeff Hawkins and Donna Dubinsky returned. Then, they outsourced our department to India and I moved on to other things. Palm really had great tech. I really think that they could have had the iPhone if 3Com hadn’t bought them. I don’t know all of the details, but it seems like the CEO of 3Com did something that ran Jeff Hawkins off. I think if he had stayed at the company that they would have released their version of a smart phone much earlier and beaten Apple. Now, whether or not they could have leveraged that early start is anyone’s guess, but it would have been interesting to see.
The Palm was a great device and IMHO better suited to personal information management than the iPhone. I used the IBM WorkPad C3 version of the Vx which perfectly fit into my hand, a Sony device with a very clever scroll wheel at the back that allowed for one-hand operation and a Tungsten E2. Without the need to make space for fingers on the screen a lot more editable information could be fit on a screen and there was no need to permanently scroll around for data entry. I could take notes faster using Graffiti than I can by typing on an iPhone. I still miss the functionality of the DateBk app. It obviously couldn't do 3D games, etc. but sharing an address or other data via IR was easier than sending stuff from one iPhone to another. In the end simplicity won, as Graffiti wasn't suitable a wider audience.