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 / 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 / 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 / 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 / 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 / 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 / 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 / missingdigit.sh
Last active June 1, 2019 08:38
Shell script test mini game...
#!/bin/sh
clear
printf "spot the (missing) digit\n"
# rnd(0..9)
r=$(($RANDOM%10))
# unix EPOCH time in seconds
t=$(($(date +%s)))
@tomaes
tomaes / fourletterwords.bas
Created May 30, 2019 16:35
One more IchigoJam game. Find the missing character in a random four-letter-word. 20 rounds, as quickly as possible. Mistake = score reset. (aka using loop markers and doing String things without String support...)
10 'four-letter words game, IchigoJam BASIC
12 CLV
14 [0]=ASC("W"): [1]=ASC("I"): [2]=ASC("S"): [3]=ASC("H")
16 [4]=ASC("Q"): [5]=ASC("U"): [6]=ASC("I"): [7]=ASC("Z")
18 [8]=ASC("L"): [9]=ASC("O"):[10]=ASC("V"):[11]=ASC("E")
20 [12]=ASC("H"):[13]=ASC("O"):[14]=ASC("M"):[15]=ASC("E")
22 :
24 @MAIN
26 CLT
27 L=RND(4)
@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",