Apparatus 2: Principia released! Get it here!
Login | Register | Sandbox Tips & Tricks

I wrote a script to generate polygons/circles

1.Look-up how to hack levels with an app called Total Commander
2. On Google Play, look for a hex editor by First Row. Install it.
3. In Apparatus, create a level containing only a small wooden plank
4. Instead of using TC's editor to edit the objects file, use the hex editor
5. three dots»tools»macro
6. paste in the following:
function integer rd(n,d)
s=(n<0)
s=1+2*s
n=n*s
if n-d*(n/d)>=d/2
n=n+d
fi
return n*s/d
end function
;created by Bengineer8
function integer sin(a)
a=a-105414357*(a/105414357)-52707179
p=a
s=a*0x1000000
n=1
while n<20
n=n+2
p=0-a*a/n/0x1000000*p/(n-1)
s=s+p
p=p/0x1000000
done
return 0-s/0x1000000
end function
function writeFloat(i,a)
e=0
if i!=0
e=125
while i/0x1000000!=0
e=e+1
i=i/2
done
while i/0x800000=0
i=i*2
e=e-1
done
if i<0
i=-i
e=e+256
fi
fi
w=e*0x800000+(i-i/0x800000)
n=a
e=0x1000000
while n<a+4
writeVal(w/e,n,1)
e=e/256
n=n+1
done
end function
function polygen(n)
writeVal(n/256,0,1)
writeVal(n,1,1)
directWriteVal(0,36*n+1,1)
d=0x1000000
ad=2
og=readStr('windows-1251',2,36)
da=105414357
k=0
r=0x500000+rd(0x1080000*sin(da/n/2+26353589),sin(da/n/2))
while k<n
directWriteStr(og,ad,1)
a=rd(da*k,n)
writeVal(k/256,ad+3,1)
writeVal(k,ad+4,1)
oa=a+26353589
writeFloat(rd(r*sin(oa),d),ad+6)
writeFloat(rd(r*sin(a),d),ad+10)
writeFloat(oa,ad+14)
ad=ad+36
k=k+1
done
print('done')
writeVal(0,36*n+1,1)
end function
polygen(strToInt(inputStr('number of sides')))

7. Save the macro
8. Press play
9. implied step
10. Wait until a few seconds after it says "done" and then hit back
11. floppy_disk»yes»hit back twice»yes
If you have any questions, you can email at bengineer8@gmail.com
If you have any problems with the hex editor, contact First Row about it, they actually reply.

Login to vote.
Level ID51619
TypeChallenge
CreatorBengineer2
Average rating1 (2 votes)
Downloads131
PublishedJul 28, 2017
Last modifiedJul 28, 2017

What's this?

Comments (refresh)