Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print ("""-- title: gen-gen
- -- author: catpants via a python script
- -- desc: uses rect() to generate patterns. lua script is generated via a python script since it's all really annoying math and who has time for editing lots of values when computers can do it?
- -- script: lua
- t=0
- x=0
- y=0
- function TIC()
- if btn(0) then y=y-1 end
- if btn(1) then y=y+1 end
- if btn(2) then x=x-1 end
- if btn(3) then x=x+1 end
- """)
- resx = 240
- resy = 136
- curxl = 0
- curxr = resx
- curyt = 0
- curyb = resy
- diff = 2
- rdiff = diff * -1
- rangevar = int((240/2)/diff)
- rangevarv = int(((240/2)/diff)/1.7)
- defaulttimevar = 0
- #left ((240/2)/diff)
- timeformula = defaulttimevar
- for each in range(rangevar):
- print ("""for borderx={},{} do""".format(curxl,curxl+diff))
- print (""" for bordery={},{} do""".format(curyt,curyb))
- print (" rect (borderx,bordery,1,1,((x+y)*(t/{})))".format(timeformula))
- print (""" end""")
- print ("""end""")
- curxl += diff
- curxr -= diff
- curyt += diff
- curyb -= diff
- timeformula += 1
- curxl = 0
- curxr = resx
- curyt = 0
- curyb = resy
- #right
- timeformula = defaulttimevar
- for each in range(rangevar):
- print ("""for borderx={},{} do""".format(curxr-diff,curxr))
- print (""" for bordery={},{} do""".format(curyt,curyb))
- print (""" rect (borderx,bordery,1,1,((x+y)*(t/{})))""".format(timeformula))
- print (""" end""")
- print ("""end""")
- curxl += diff
- curxr -= diff
- curyt += diff
- curyb -= diff
- timeformula += 1
- #top
- curxl = diff
- curxr = resx-diff
- curyt = 0
- curyb = resy
- timeformula = defaulttimevar
- for each in range(rangevarv):
- print ("""for borderx={},{} do""".format(curxl,curxr))
- print (""" for bordery={},{} do""".format(curyt,curyt+diff))
- print (""" rect (borderx,bordery,1,1,((x+y)*(t/{})))""".format(timeformula))
- print (""" end""")
- print ("""end""")
- curxl += diff
- curxr -= diff
- curyt += diff
- curyb -= diff
- timeformula += 1
- #bottom
- curxl = diff
- curxr = resx-diff
- curyt = 0
- curyb = resy
- timeformula = defaulttimevar
- for each in range(rangevarv):
- print ("""for borderx={},{} do""".format(curxl,curxr))
- print (""" for bordery={},{} do""".format(curyb-diff,curyb))
- print (""" rect (borderx,bordery,1,1,((x+y)*(t/{})))""".format(timeformula))
- print (""" end""")
- print ("""end""")
- curxl += diff
- curxr -= diff
- curyt += diff
- curyb -= diff
- timeformula += 1
- print ("""
- t=t+1
- end""")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement