Skip to content
/ theseus Public

Creating and solving a maze in only 256 bytes of JavaScript.

Notifications You must be signed in to change notification settings

aemkei/theseus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Theseus

Creating and solving a maze in only 256 bytes of JavaScript.



    ,@,@,@,@,@,@,@,@,@,@,@,
    ,+,+,+,+,+,+,@, , , ,@,
    ,@, ,@,@,@,+,@, ,@, ,@,
    ,@, ,@,+,+,+,@, ,@, ,@,
    ,@,@,@,+,@,@,@,@,@, ,@,
    ,@,+,+,+,@, , , , , ,@,
    ,@,+,@,@,@,+,@, ,@,@,@,
    ,@,+,@, , ,+,@, ,@, ,@,
    ,@,+,@,@,@,+,@, ,@, ,@,
    ,@,+,+,+,+,+,@, , , ,@,
    ,@,@,@,@,@,@,@,@,@,@,@

Minimal Source (256 bytes):

for(z=[c=66,i=132];i--;X=a=>_.map((b,e)=>
1<z[b=a+2*_[3&e+i]]&&X(b,i=9*Math.random(
z[b]=z[(a+b)/2]=F=0))))_=[-12,z[i]=i%12?5
:-1,12,1];for(X(14);F<2;F?0:$=[...z],$[13
]=$[c]=4)c^14?z[c]=z[c]+~F&3:c=++F&&66,5>
z[n=c+_[z[c]]]&&(c=n);""+$.map(b=>`
    +@`[++b])

Links

About

Creating and solving a maze in only 256 bytes of JavaScript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages