Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
A jam submission

Fourier series in PICO-8 #Pico1kView game page

Submitted by ThaCuber (@thacuber2a03) — 21 days, 18 hours before the deadline
Add to collection

Play demo

Fourier series in PICO-8 #Pico1k's itch.io page

Characters/Bytes used
340 characters, totaling 350 bytes. Tried to fit it in a tweet but couldn't.

Source Code
c=camera l=line b=btnp t=0i=0w={}::_::t-=0.0174533if(b(➡️))i+=1
if(b(⬅️))i-=1
cls()c(0,0)?"< > to change iters:"..i,7
c(-32,-64)x=0y=0for i=0,i do px=x py=y n=i*2+1r=20*(4/(n*3.14))x+=r*cos(n*t)y+=r*sin(n*t)circ(px,py,r,5)l(px,py,x,y,7)end l(x,y,32,y, 6)add(w,y,1) if(#w>63)del(w,w[#w])
c(-64,-64)for i=1,#w do pset(i,w[i],7)end flip()goto _

Link to Commented Source Code
https://hastebin.com/vorofuqumu.lua

Leave a comment

Log in with itch.io to leave a comment.

Comments

Submitted

This is a really neat visualization! Enjoyed squishing the sines into squares and back :)

Developer

thanks!

HostSubmitted

This is a really cool & interesting visualisation.
Nice one! 🤓👍

Submitted (1 edit) (+1)

Very nice! Trimmed to fit in a tweet (279 chars, 279 bytes):

s=-64t=0i=0w={}c=camera::_::t-=.02if(btnp(1))i+=1
if(btnp(0))i-=1
cls()c()?"<>it:"..i
c(-32,s)x=0y=0for n=1,i*2+1,2do p=x q=y r=(25/n)x+=r*cos(n*t)y+=r*sin(n*t)circ(p,q,r,5)line(p,q,x,y,7)end line(x,y,32,y,6)add(w,y,1)deli(w,64)
c(s,s)for i=1,#w do pset(i,w[i],7)end flip()goto _

Developer(+1)

oh wow, thanks! i never thought about making the -64 a variable, and never thought about using deli either!

you even shortened the string after the shortened print function 😅

Developer(+1)

this is technically my first ever cart made with a incredibly small amount of characters so if you can help me make it better it would be really appreciated!