BASIC 10Liners 2018

I recently heard about a contest to write a game in BASIC using only 10 lines. One of the requirements is that it be done on an 8-bit computer. I've been tinkering a lot with my old Tandy Model 102 so I thought this would be a fun project for it.

My original idea was to try to make a very simplified RPG-type game but I just couldn't fit it into 10 lines. Instead I switched gears and recreated a little game I had originally written on my TRS-80 PC-3 Pocket Computer back in the 1980s. My original PC-3 game was a javelin throwing game. Although I had a CoCo 2, my best friend had a Commodore 64 and we played a lot of Summer Games II which was my inspiration. Unlike the PC-4, the PC-3 didn't have any graphics characters built in and there were no bitmapped graphics either, so my program simply alternated printing X and Y as your player moved to sort of simulate running. Then when you hit a different key to throw your javelin the animation changed to moving a dash ( - ) across the sreen until it landed as a slash ( \ ) to look like a javelin stuck in the ground. It was the best I could do on a text-only single line display.

The source code for that game has long been lost so I had to remake it from scratch. I also made some changes from how I remember it, both for the contest rules, and to take advantage of the more powerful computer and larger screen. The Model 102 has two ASCII characters that look like stick figures in slightly different poses so I was able to use those instead of the X and Y of my original. I also changed the game to a long jump instead of javelin throw because with more than one line of text available on the Model 102 screen I could include a jump animation which looks better than my animated dash in the original. But the general gameplay is exactly the same. Basically you hit two keys on the keyboard as fast as possible until your player reaches a line on the screen then you hit another key to throw or jump. The distance you throw/jump is based on the speed you were hitting the keys and how close you were to the line.

There are some pretty amazing entries to the contest so I'm not expecting to place anywhere near the top, nevertheless, I'm pretty happy with the result given I only have 10 lines at 80 characters per line to work with.

The code is availabe on github https://github.com/ksbex/basic-longjump

Screen-Recording-2018-03-06-15-39-21.gif

Frogs

I dislike that fact that I feel the need to post this but I feel it is important even though it will probably go unnoticed. This isn't exactly a high-traffic blog but it's mine and I want to at least have an explanation should the question of my frog logo arise.

Years ago when I started this blog as a self-hosted Wordpress site I was messing with favicons and I was amused by the frog favicon that I still have today. When I moved to Squarespace, I was playing with their Logo maker and decided to add a frog image to my header as well. There is literally no reason for it other than I found it amusing.

Now, years later the Pepe meme has become a symbol of the alt-right and I've been seeing frog emojii 🐸 popping up associated with alt-right twitter accounts and this stupid gabi social network (which I'm sure is a pleasant place to socialize) and it occured to me that my stupid frog logo might be seen as dog whistle or something. So I just want to publicly state that it's not. Sometimes a frog is just a frog.

Bypassing a Proxy Server for a Single Host on OS X When Using PAC file

Recently I wanted to mess around with a little PHP and I needed a quick and easy route to getting a LAMP stack running. Rather than set it all up from scratch, I decided to give Turnkey Linux a try. I downloaded a small OVA file and had it up and running in VMWare Fusion in no time with one catch; I couldn't connect to the webserver from my Mac. SSH was working so I knew the VM was reachable. I disabled the setting for my proxy server and immediately it was working. I had hoped I could just add my virtual host to the "Bypass proxy settings for these Hosts & Domains" box but it turns out that only works for simple proxy configs. The problem is that OS X will ignore this setting if you use a PAC (proxy auto config) file, which we do at my workplace.

Eventually I came with with a little hack to get around it. The PAC file is configured to bypass the proxy for our entire FQDN for our Active Directory domain, so I just created an entry for my virtual machine in /etc/hosts called lamp.my.company.domain.com and I was good to go!

MACXXXXXXXXXX:bin kevin$ cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1    localhost
255.255.255.255    broadcasthost
::1             localhost 
172.16.21.129   lamp.my.company.domain.com
MACXXXXXXXXXX:bin kevin$ 

iOS Photo Management

Serenity Caldwell recently wrote an article titled "I've abandoned my Mac for photo import and editing." which was interesting because I've had a similar experience but for somewhat different reasons. I don't have an iPad Pro so I can't use the Pencil for photo retouching as she does, but I also don't have her aversion to using a trackpad for precision work. I'm comfortable using my trackpad for photo retouching, the fact is though, that I rarely need to do precision photo editing. I mostly just make some exposure adjustments and perhaps a bit of cropping, both of which work very nicely on an iPad. I find it much easier to sit down on the couch with my iPad at the end of the day, pop in my SD card, and import my photos. I can quickly delete the ones I don't want and do minor enhancements on the ones I keep. When I was using my Mac for this, it felt more like a chore so I would put it off for days or weeks before I eventually dealt with it. This meant that when I finally got around to it I had more photos to sift through, which means spending less time actually selecting and enhancing the best ones. Importing smaller batches as I take them actually keeps my photo library smaller and makes the remaining pictures look better.

Serenity's complaints about the added complexity of the workflow for photo management on OS X had never really occurred to me before reading her article. Although she is correct, for the most part it rarely was an issue for me because I am not taking photos for publication. I just dump them into my library, and I'm happy to stick to sorting them by date. However just today I was struck by how bizarrely complicated it is to add a photo from an email directly to my photo library on OS X. An actual photo attachment will let you "Export to Photos" from the context menu but an embedded link to a photo in an HTML email has no option in Mail.app to save the image at all, only to copy it. After copying the email I can use Preview to create a "New from clipboard" image but Preview also lacks a direct export to Photos. So now I need to temporarily save the file on my desktop and the launch Photos to import it, then go back and delete the file from my desktop. On iOS I just long press the photo, tap "Save Image" and I'm done. It's crazy that even if I am sitting at my iMac looking at a photo in an email and the easiest way to save it is to pick up my phone and do it from there.