Calculator Blackjack and Simon

Here are the first two programs I ever wrote. Before discovering “real” computer programming, I used to be pretty big into the graphing calculator scene.

Blackjack features a text UI, betting over multiple rounds, player high score, basic input validation, automatic ace lowering, and three turn options. Simon is a clone of the classic memory game with programmatically drawn graphics and gradually increasing tempo.

 

Coding on a calculator is funny business. It’s like writing and optimizing assembly by hand in a language that has nowhere near the performance of real assembly. Some fun facts about TI-BASIC:

On the upside, math support is excellent :)

Below is the source code for Simon’s input loop. The full source, binaries, and installation instructions for both programs are available on GitHub.

For(I,1,L
0
Repeat Ans
getKey
End
Ans→G
If G=11:Goto M
If G=15:Goto 0
If sum(G={24,25,26,34
Then
.2(11+(G=25)-(G=34)+10((G=26)-(G=24→K
If K≠L6(I
Then
Goto L
Else
2+iPart(K→X
2+10fPart(K→Y
Pt-On(X,Y,3
For(T,1,70
End
Pt-Off(X,Y,3
End
Else
I-1→I
End
End
End