Skip to content

Instantly share code, notes, and snippets.

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

tomaes

💭
Programming is for AIs. Let's go shopping.
  • Germany
Block or report user

Report or block tomaes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tomaes
tomaes / blocktumble.txt
Last active May 30, 2019
a few notes on block tumble!
View blocktumble.txt
"Block Tumble!" is a humble Commodore 64 puzzle game from 1991 in 2KBytes; it features 56(!) levels.
Here are some random notes I took while poking around in memory...
observations:
- the level encoding is fixed: 18 Bytes x 56 = 1008 Bytes
- the level data starts at 0BF9 (in memory), or at 03FA (file offset)
- a better, flexible encoding of the level data should take around ~870 Bytes
(assuming a not-too-crowded field in most levels and on average at least 8 wall stones)
(also: discussing level encoding should be a separate post, as there are MANY options :))
@tomaes
tomaes / mem20.bas
Last active Oct 30, 2016
Short (eh) memory card game for the standard VIC20 (should work on all the 8-bit Commodore machines, I think...)
View mem20.bas
0 fori=.to7step2:m(i)=i+2:m(i+1)=i+2:next:r=1
1 forj=.to9:fori=.to7:a=int(rnd(.)*8):h=m(i):m(i)=m(a):m(a)=h:nexti,j
2 print"#:"r:fori=.to7:printi;chr$(63+(m(i)<0)):next
3 r=r+1:input"cards";a,b:if(a=b)or((m(a)orm(b))<0)goto3
5 printchr$(13)m(a)m(b)chr$(13):ifm(a)=m(b)thenm(a)=-m(a):m(b)=-m(b)
8 s=.:fori=.to7:s=s+m(i):next:if(s>-40)goto2
@tomaes
tomaes / oneliners.glsl
Last active Feb 11, 2019
shadertoy GLSL oneliners
View oneliners.glsl
// fragment shader one-liners
// note: some might break for timing reasons (iDate.a/iDate.w) and some for compatibility reasons ("f+=" on a Mac, f.e.)
//
// void mainImage( out vec4 f, vec2 p )
// and then...
// "flames (red)"
{f=vec4(p.x/p.y*mod(sin(p.x-iDate.a),.001*length(p-.9)),.2,.5,1.0);}
// "rain (small)"
@tomaes
tomaes / flatenthemout.pde
Last active Apr 11, 2016
Sierpinsky Carpet bömbing; stylish fractal things + parallax scrolling
View flatenthemout.pde
// PDE 3.02
// Sierpinski's Carpet bömbing (v3)
// updt: better, faster, interactive
PImage img = createImage(729,729, RGB);
void setup()
{
size( 729, 729, P2D ); //729 243 324
}
View northern_lights
; working title: sea changes near wallpaper city
*= $801
byte $0B, $08, $0A, $00, $9E, $34, $30, $39, $36, $00, $00, $00
chars
byte 78, 77, 73, 75, 242, 66, 97, 72
txt
byte 13, 5; color
text "E-SIRAMIS " ; 10b
@tomaes
tomaes / s_atan
Last active Aug 29, 2015
holy colorful patterns, batman. (c64)
View s_atan
0 s=4^5:f=55296:w=40:c=85:h=198:z=z+.05:fory=.to24:forx=.to39
1 v=abs(atn(sin(x*y*z)*.5)*3):pokes+y*w+x,c+v:pokef+y*w+x,4+v:nextx,y
3 print"{home}[key]":pokeh,.:waith,1:goto
@tomaes
tomaes / heart curve (c128)
Created May 30, 2014
Someone was asking for this. ;)
View heart curve (c128)
1 rem c128 heart curve
2 color 4,5: rem bg
4 color 0,1: rem screen
6 color 1,3: rem drawing color
8 graphic 1,1:h=200:hh=100:wh=160:cw=10:ch=6
10 forx=-.99to1step.06
20 q=sqr(1-x*x)
22 y0=sqr(x*x)-q
24 y1=sqr(x*x)+q
44 xa=int((x+1)*wh):ya=h-int((y0+1)*hh)
@tomaes
tomaes / micro note
Last active Aug 29, 2015
mini note file viewer. rev2 with multi-page support. (c64)
View micro note
;
; a minimal noter example with generated audio, BASIC header and multi-page support
;
* = $801
; 0 SYS4096
byte $0B, $08, $00, $00, $9E, '4', '0', '9', '6', $00, $00, $00
* = $1000
@tomaes
tomaes / flower tower
Last active Aug 29, 2015
54 wasteful bytes; looks kinda neat though. interactive. (c64)
View flower tower
;
; wallpaper scroll / flower tower (interactive)
;
* = 4096
lda #6
sta $d020
start ;
; user input to init field color and width
;
@tomaes
tomaes / Plop-8
Last active Aug 29, 2015
Mini step sequencer. 7 volume levels per cell. Press <1> to <8> to program some ploppy beats. 116 bytes. c64 again.
View Plop-8
0 n=54296:geti:s(i)=(s(i)+1)and7:fori=1to8:poke1024+i,s(i):next:p=(p+1)and7
2 poke1065+p,30:fori=.to99:next:poke1065+p,32:poken,s(p+1):poken,.:goto
You can’t perform that action at this time.