Skip to content

Instantly share code, notes, and snippets.

View tomaes's full-sized avatar
💭
Programming is for AIs. Let's go shopping.

tomaes

💭
Programming is for AIs. Let's go shopping.
View GitHub Profile
@tomaes
tomaes / m-thh-ste.bas
Last active March 25, 2021 08:21
BBC micro test game; random 2nd grader arithmetic at devilish velocity.
AUTO 10, 10
REM MICRO GAME FOR THE BBC MICRO
MODE 7
PRINT CHR$(141); CHR$(134); "MATH HASTE": REM 2X HEIGHT (top), cyan
PRINT CHR$(141); CHR$(130); "METH HESTE": REM 2X HEIGHT (bottom), green
DIM Q(6): DIM Q$(6): D = 2: R = 0
@tomaes
tomaes / lasercannon.bas
Last active June 9, 2020 07:30
My first game with "graphics" (ca. 1993, on C64) remade. Commodore Basic v2 + "Hires-Master" extension. (v2.6)
0 if peek(51300)<>83 then print "hires-master v1.0 required!": stop
1 j=56320
2 s=53280: si=54272
3 jl=123: jr=119: ju=126: jd=125
5 jx=127: jf=111: lx=319: ly=199
7 mx=160: my=100: lv=1: cn=1
9 r=26 : q=10 : bx=30
11 dim y(200): n$=chr$(13)
12 :::
14 poke s,0: poke s+1,0
@tomaes
tomaes / nnjblitz.pas
Last active May 22, 2020 06:26
16-bit DOS game. Download binary from https://tomaes.itch.io/ninja-blitz
{
Ninja Blitz
A spin on city bomber games
for 1980s era 16 bit DOS PCs
designed & written by
Thomas "tomaes" Gruetzmacher
in May 2020
@tomaes
tomaes / 1bpp_txtrle.pas
Last active May 7, 2020 16:03
40x25 1bpp RLE test (/w wholesome pic)
program one_bpp_txt_rle; { 2020-05-05/07 omi edition }
var s,p: string; i,j: word; q: byte;
begin
s := #52#18#21#20#19#22#17#4#2#3#2#3#2#3#2#3#16#3#18#3#16#3#1#3#9#3#2;
s := s + #3#16#3#1#1#2#1#3#1#4#1#2#1#1#3#16#3#8#1#9#3#16#3#2#1#5#1#5#1#3;
s := s + #3#16#3#2#1#5#1#5#1#3#3#16#3#8#2#8#3#15#4#18#3#15#4#12#1#5#4#14#3;
s := s + #5#1#1#6#7#3#16#1#20#1#19#1#7#4#7#1#20#1#18#1#21#1#16#1#23#16#23;
s := s + #1#2#1#10#1#2#1#20#2#4#1#2#1#2#1#2#1#4#2#17#1#7#2#1#2#1#2#7#1;
s := s + #15#1#24#1#14#1#24#1#6;
@tomaes
tomaes / packmann.pas
Last active May 5, 2020 07:19
PACK-MANN (1989) by Gerd Brinkmann; translated, fixed, extended. Initial commit: Original version.
(**************************************************
*** P A C K - M A N N ***
*** (W) 1989 by G. Brinkmann ***
*** MS-DOS, Turbo Pascal 4.0/5.0, 06.04.1989 ***
**************************************************)
{ Revised & extended version 2.0 in April/May 2020 by tomaes
NEW in this edition:
- source & game translation (German->English),
- code clean-up, structual improvements & fixes
@tomaes
tomaes / playAMDdump.pas
Last active April 16, 2020 09:32
AMD song file dump OPL2/Adlib player test
program PlayAMDdump;
(* adlib player lib by conqueror in '96 *)
(* song and array player hack by tomaes in '20 :) *)
uses CRT;
{$F+}
{$L amdobj.obj}
procedure _AdlibPlayer; near; external;
procedure _StopAdlib; near; external;
procedure _InitAdlib; near; external;
@tomaes
tomaes / cbm4032game.bas
Last active March 22, 2020 19:10
Snake ✕ Tron; CBM4032 / Commodore PET game.
0 rem cbm 4032 game test
1 :
2 sm=32768: h=sm+414
3 x=0: y=0: dx=1: dy=0
4 lv=0: g0=1: pl(0)=15: pl(1)=86
5 u$="w": l$="a": d$="s": r$="d"
6 print chr$(147)spc(250)spc(158)
7 print "snake * tron. get ready!"
8 fori=.to99:pokeh,32::::::::::pokeh,83:next
9 poke 59467,16: rem sound on
@tomaes
tomaes / noshowdieface.rb
Last active May 31, 2019 06:31
Spot the missing die face as quickly as possible. Micro game in Ruby.
# No-Show Die Face, a micro game in Ruby
r = 0
e = false
s = Time.now.to_f
begin
# die faces 1 to 6
n = { 1 => "\u2680",
@tomaes
tomaes / heartcash2.bas
Last active May 25, 2019 09:43
IchigoJam mini game; collect coins and hearts in equal amounts and leave when you have enough of both.
5 'heartcash II
10 CLS
12 Y=0: M=20: H=20: P=229
14 C=245: D=C-P: O=320: L=O/32
16 LC 0,L-1: ? CHR$(226);" exit::::::::::::::::::::::::"
18 LC 0,L+2: ? CHR$(227);" exit::::::::::::::::::::::::"
20 IF RND(8) POKE#91E+O+32*RND(2),P+RND(2)*D
30 COPY #900+O,#901+O,31: COPY #920+O,#921+O,31
50 Y=Y-BTN(UP)+BTN(DOWN)
51 IF M M=M-1
@tomaes
tomaes / minesonar_enhanced.bas
Created May 23, 2019 16:35
Minesonar, enhanced. IchigoJam edition. With a fancy title header.
10 ' minesonar enhanced, IchigoJam Edition
20 CLS: CLT
30 LET R, 0
32 LET X, RND(8)+1
34 LET Y, RND(8)+1
35 :
38 ? ".";CHR$(251);: ? " Mine Sonar,IchigoJam edition"
39 ? CHR$(154);: FOR I=1 TO 28: ? CHR$(176);: NEXT: ? "*"; CHR$(244)
40 ?: ? "There is a (possibly moving)"
42 ? "hidden mine in an 8x8 field!"