Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

I'm trying to learn JavaScript

Name: Anonymous 2018-10-25 12:02

That is what I wrote so far:
https://jsfiddle.net/Nikita_Sadkov/4h72j5s6/

Name: Anonymous 2018-11-22 5:38

New fire algorithm
https://jsfiddle.net/Nikita_Sadkov/mgLp4eut/

This time stolen from the following Lua demo.

I have yet to see more broken language than Lua and JS, they are both horrible in almost every aspect.

w=120
h=100


buf={}
palete={15,15,
14,14,
9,9,
6,6,
3,
7,
1,
0}


function TIC()

--Init matrix
if t==0 then
for x=0,w do
buf[x]={}
for y=0,h do
buf[x][y]=0
end
end
end

--Reduce load on CPU
if(t%8/2==1) then
--Clear screen
cls(0)
--Text
print("Fire Walk with me",70,80)

--Move Fire And Smooth
for x=1,w-1 do
for y=1,h do
c=buf[x][y]
if c then
b=buf[x][y-1] or 0
t=buf[x][y+1] or 0
l=buf[x-1][y] or 10
r=buf[x+1][y] or 10
c=math.floor((b+t+l+r)/3.2)
end
buf[x][y-2]=c
end
end

--Add more fire at bottom
for x=0,w do
buf[x][h]=math.random(1,4)
buf[x][h-1]= buf[x][h]
end


--Draw Fire
for x=0,w do
for y=0,h do
c=palete[buf[x][y]]
if c then pix(60+x,138+y-h,c)end
end
end
end

t=t+1
end

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List