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 / jump.pas
Created April 14, 2020 10:57
Testing the limits of recursion in Turbo Pascal 7.0 (1992)
(*
TP 7.0 recursion limit test: 3965 - stack:16384 (def)
16249 - stack:65520 (max)
*)
program rec_test;
{$M 65520, 0, 655360} (* stack, heapmin, heapmax *)
uses crt;
const R = 16249;
var i: integer;
@tomaes
tomaes / dotvszero.bas
Last active April 15, 2020 16:42
P=. versus P=0 actually makes a significant difference (plus4, PET, C64, VC20)
10 rem p=. vs p=0 results:
11 rem plus4 : 16%
12 rem pet : 19%
13 rem c64 : 20%
14 rem vc20 : 22%
15 :
20 t=ti
21 for i=0 to 499: p=0: next
22 a=ti-t
23 print "p=0 :";a
@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 / hz.pas
Created May 4, 2020 07:19
Audio micro game. Make it through 12 rounds of approximate frequency estimation.
program Hz; {sound micro game; 2020-5-4}
uses crt;
var f,q,p,r: integer; s: string;
begin
clrscr;
writeln('Guess My Frequency (20-2000Hz)');
randomize;
r := 0; s := '';
repeat
f := random(1980)+20;
@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 / 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 / countrypop.plus4.bas
Last active December 4, 2020 10:26
A population quiz game in moreorless.io style (Commodore Plus/4 version)
0 rem _,/'%%&&&&&&&&&&&&&&&&&%%'\__
1 rem ((_country pop plus/4 version_))
2 rem \_\%%%%%%%%%%%%%%%%%%%%%%%/_/
7 : :
8 : v$ = "v1.2f, May/June 2020" :
9 : :
10 rem init '''''''''''''''''''''';
11 vol 5: n=20
12 dim c$(n),c(n),hi$(6),di(6)
13 dim ac$(n),ao$(n),ap(n),aa(n)
@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 / colaconvert.bas
Last active June 12, 2020 12:03
Filters and converts Petscii Cola data to chr$() codes when exported to BASIC.
0 rem petscii cola chr$() filter/converter stub code
1 print "wait.": n=999: f=32: dim d(1000), cc(1000)
2 for i=0 to n: read a: d(i)=a: next: i=-1
3 i=i+1: on -(d(i)=f) goto 3: s=i: i=1000
4 i=i-1: on -(d(i)=f) goto 4: e=i
5 print "start:"s;"end:"e: print "ok. converting data": j=0
6 for i=s to e: re=0
7 : if d(i) >= 128 then re=1: d(i)=d(i)-128
8 : if d(i) < 32 then cc(j) = d(i)+64
9 : if d(i) <= 63 and d(i) >= 32 then cc(j) = d(i)
@tomaes
tomaes / sidtest.comal
Last active June 21, 2020 14:54
SID sounds test tool (verbose), written in COMAL-80
auto 100,4
// SID test mini
// in COMAL-80
// ----------
// procedures
// ----------
proc wait(count)