Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Programming is for AIs. Let's go shopping.

tomaes

💭
Programming is for AIs. Let's go shopping.
View GitHub Profile
@tomaes
tomaes / senso.bas
Last active Apr 4, 2021
Senso's Telephone for the BBC Micro. BASIC 10 liner contest entry: https://gkanold.wixsite.com/homeputerium/rules2021
View senso.bas
0REM "MR.SENSO IS A PECULIAR MAN. HIS PHONE NUMBER IS MADE OF"
1REM "1S AND 0S ONLY. PLEASE MEMORIZE HIS NUMBER. HE WOULD APPRECIATE IT."
2DIMA(19):L=0:E=0:BRK=0:MODE7:PRINTTAB(0,12)"SENSO'S TELEPH0NE":H$=INKEY$(249)
3K=48:REPEAT:L=L+1:A(L)=K+(RND(2)-1):IFL>1THENPRINT" NICE!":H$=INKEY$(89)
4CLS:PRINTTAB(0,12)"LISTEN "CHR$(93);:FORI=1TOL:PRINTCHR$(A(I));:T0M=&2A
5SOUND1,-9,129+(A(I)-K)*K,4:H$=INKEY$(89):NEXT:H$=INKEY$(99):PRINTTAB(0,12);
6PRINTSPC(35)TAB(0,12)"NOW, REPEAT ";CHR$(93);:FORI=1TOL:A$=GET$:PRINTA$;
7IFA$<>CHR$(A(I))THENBRK=1:E=E+1:SOUND1,-9,5,6ELSESOUND1,-9,109+(A(I)-K)*K,4
8NEXT:H$=INKEY$(89):UNTILBRK OR L=19:PRINT:PRINTTAB(0,12)"ROUNDS:";L;"/19 ";
9PRINT"TYPOS:";E;SPC(15):IFL<19THENPRINT"GO AGAIN!"ELSEPRINT"MR.SENSO APPR0VES"
@tomaes
tomaes / m-thh-ste.bas
Last active Mar 25, 2021
BBC micro test game; random 2nd grader arithmetic at devilish velocity.
View m-thh-ste.bas
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 / drumbit.json
Last active Mar 9, 2021
drumbit.app pattern and beat collection
View drumbit.json
{"name":"drumbit","metadata":{"author":"tomaes","title":"hectic","remarks":""},"options":{"tempo":160,"swing":0,"kit":"11","effect":{"id":"6","level":0.5},"compressor":{"bypass":1,"threshold":-20,"ratio":4,"attack":0.0010000000474974513,"release":0.25,"knee":5},"lowpass":{"bypass":1,"frequency":800,"q":1},"highpass":{"bypass":1,"frequency":800,"q":1}},"pattern1":{"track1":{"vol":1,"pan":1,"pitch":2,"steps":[0,1,0,0,0,0,1,0,0,1,0,0,0,1,0,0]},"track2":{"vol":0.9,"pan":1,"pitch":2,"steps":[0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0]},"track3":{"vol":0.7,"pan":1,"pitch":0.8,"steps":[0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0]},"track4":{"vol":1,"pan":1,"pitch":2,"steps":[0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1]},"track5":{"vol":1,"pan":1,"pitch":1.9,"steps":[0,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0]},"track6":{"vol":1,"pan":1,"pitch":1,"steps":[1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0]},"track7":{"vol":1,"pan":1,"pitch":0.7,"steps":[0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0]},"track8":{"vol":1,"pan":1,"pitch":1.4,"steps":[0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0]}},"pattern2":{"
@tomaes
tomaes / jenbeats.txt
Last active Mar 6, 2021
"Spinning Jenny" Jams (c64 drum computer tool tabs)
View jenbeats.txt
Kit #1 (standard), tempo E000
F1 C-761-AAC-7-1-A-C-761-AAC-7-1-A-
: : : : : : : :
F3 12118-19-CC-1-B-9---4--21-B2C---
: : : : : : : :
F5 7-CB2-1-7-B-2-1-7-B-2---7-B-2---
: : : : : : : :
F7 1AB21-454-1-5-1-1-5B1-454-1-5B1-
View fluffy.bas
10 REM フワフワ GW-BASIC port /w sound
11 CLS: RANDOMIZE TIMER
12 XM=80: YM=24: X=XM/2: Y=1: OC=239: L=30
14 B=INT(RND*(XM-L*2))+L: SOUND 200,.5
15 UP=0: L=30-S/10: IF L<1 THEN L=1
16 LOCATE YM,B: PRINT CHR$(OC)
17 A$=INKEY$: X=X+(A$="a")-(A$="s")
18 IF SCREEN(Y+1,X)=OC THEN Y=Y+1: SOUND 800,1
19 IF SCREEN(Y,X)=OC THEN GOSUB 40 ELSE Y=Y+1
20 IF X<1 OR X>XM OR Y<1 OR Y>YM THEN 30
@tomaes
tomaes / raster-fari
Created Mar 22, 2014
16 bytes for a fairly nice looking (and flicker free) static raster effect (c64)
View raster-fari
* = $7c ; zeropage boot-up (for VICE)
sei ; no interupts, no flickering
sty $d011 ; background frame is now everywhere
cpy $d012 ; wait for next raster line
bne *-3 ;
sty $d020 ; set fullscreen color
iny ; wait 2 lines (looks best)
iny ;
bvc *-10 ; loop quickly
@tomaes
tomaes / countrypop.plus4.bas
Last active Dec 4, 2020
A population quiz game in moreorless.io style (Commodore Plus/4 version)
View countrypop.plus4.bas
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 / whatletteristhateven.bas
Last active Jun 26, 2020
Decipher the mangled multicolor mode letters and react quickly. 50+ rounds for the ending. Part memory game, part reaction game in 3 lines of CBM Basic v3.5+ (Commodore 128/+4)
View whatletteristhateven.bas
0 graphic3,1:m=999:do:c$=chr$(rnd(1)*26+65):char,rnd(1)*40,rnd(1)*25,c$:s=s+t*r
1 r=r+1:t=400-r*5:do:geta$:t=t-1:s=s+(a$<>c$)*m-(a$="")*m:loopwhilea$<>c$andt>.
2 loopwhilea$=c$:graphic.,1:print"#"r"score:"s"letter:"c$:ifr>49thenprint"wow!"
@tomaes
tomaes / hrhr
Created Mar 19, 2014
An unlikely, but perfectly valid Commodore Basic program. :) (this works, because any non-literal (or even emptiness) after "go to" = 0 and "go to" is an alternative version of "goto", that no one ever used.)
View hrhr
0 GO TO INFINITY
@tomaes
tomaes / square_chicken
Created May 11, 2014
1/2 a frogger (c64); 165 bytes for some stylish, minimal gaming action.
View square_chicken
0 s=53248:x=8:pokes+21,1:pokes,x:pokes+1,120:pokes+39,2
5 printspc(int(rnd(1)*5)*6+4)"{yellow}{110}{green}{109}":r=r+1
8 geta$:x=x+(a$="{left}")*8-(a$="{right}")*8:pokes,x:ifx<248and(peek(s+31)andr>20)=.goto5
9 print"score:"x*8-r*2