Applesoft BASIC Maze Game
Winter 2021
Recently, I came across a small one-weekend virtual Hackathon hosted by Stuyvesant high school, and I decided to enter with a team of 2 other friends. Building off my previous experience with the Apple II, I used an online emulator and wrote graphics code isolated as a subroutine that could be called to draw a frame. I then wrote some simple maze generation and movement code, and implemented procedural level generation of increasing difficulty. The main game code would wait for player input, then calculate the polygons that needed to be drawn for the movement. These polygons were then transformed and drawn on the background high-resolution graphics layer, before the new frame was swapped to the foreground. Because occlusion was too complex to implement within the graphics constraints of the machine, an approximate breath-first search algorithm was used to determine which tiles needed to be drawn. Ultimately, our team won third place!
The source code is available on GitHub.
The hackathon submission is available on Devpost.
Semantic Word Groupings
Fall 2021
This was created as an extension of an assignment in English class involving grouping vocabulary words. I collaborated with a friend over GitHub in conjunction with the Visual Studio Code LiveShare extension. We used the Gensim Word2Vec Python API to download the fasttext-wiki-news-subwords-300 dataset, which assigned each word in the dataset a 300 dimensional vector representing its position in semantic space – “similar” words would be relatively close together in space. We then used Numpy to project the data into 2 dimensions (to avoid the breakdown of euclidian distance in high-dimensional space), and applied k-means clustering with 4 groupings. The groupings were then plotted in projected space with matplotlib, yielding the above graphic.
The source code is available on GitHub.
MicroPython Battleship
Fall 2021
the placement phase
This was created as a small, one-day project. I decided that it would be interesting to try and create a small game for my calculator, a N0100 Numworks, which runs MicroPython. Settling on battleship, I was able to create a simple implementation which allowed for the calculator to switch hands before the other player’s board was rendered. During the project, I worked around the calculator’s slow screen refresh rate and low-resolution graphics. The final product contains all basic battleship functionality, including ship placement, hit markers, and win detection.
The source code is available on GitHub.
Applesoft BASIC Mesh Rasterizer
Summer 2021
At the start of the summer, I visited the InfoAge Science Center in Wall Township, NJ. There was a collection of old computers, including a Bulgarian Pravetz (Правец), the same computer my mother had access to during high school in Bulgaria. The computer was a communist knockoff of the Apple II, and ran programs written in Applesoft BASIC. I did not have time to do anything substantial with it at the time, but being interested, I later used an online emulator and wrote a simple 3d mesh rasterizer for an Apple II. As is tradition for 3d graphics, I decided that I had to render the Utah teapot in the program. Finding an extremely low-poly 3d model of the teapot in the OFF format, I wrote a python program to extract the vertex and face data from the file and change it to a format my program could use easily. The model can be rotated and translated in space, though each rendering takes several seconds due to the nature of the system.
The source code is available on GitHub.
Robotics simulation
Winter 2020 / 2021
Godot-side view of the field
During the 2020-2021 school year, I joined the robotics club to help compete in the First Tech Challenge (FTC). We had to build a robot that would navigate an arena, collect and launch disks, and move cones. Because of the coronavirus situation during the winter, we were unable to meet in person, and I did not have access to the robot. I decided to use my experience with Godot to create a model of the arena and robot for testing. I then connected this to my Java codebase using a websocket such that I could control the robot in Godot from a Java IDE. Unfortunately, my school decided to not participate in the competition because of coronavirus, and I stopped development. Despite this, the existing codebase contains a reasonably complete event and movement system based around 4 different ultrasonic sensors. The code operates on a simple movement loop:
- The robot calculates expected sensor readings after a movement
- The robot begins to execute the movement, either a rotation or a translation.
- The sensor readings are continuously compared to the expected ones until a close match is found.
- The robot halts.
- A repeated brute-force position calibration is done by comparing real and expected sensor values with the anticipated position of the robot used as a starting point.
There are also additional complications to handle false sensor matches arising from the 4-fold symmetry of the field. Error tolerance logic is also present to account for inaccuracies in sensor measurement.
The source code is available on GitHub.
Tennis Ball Squeeze Counter
Spring 2020
During the spring in 9th grade, we were assigned an investigation of muscle fatigue which included an experiment about the rate at which we could squeeze a tennis ball over time. To do this more precisely, I cut a slit in a tennis ball, wrapped aluminum foil around the edges so it would act like a switch when the slit was opened and closed, and connected the ball to a simple Arduino circuit. The Arduino then measured the resistance of the circuit over time to determine if the ball was open or closed and used that information to count squeezes. It then averaged the data over each period of 10 seconds.
The source code is available on GitHub.