Fixed:
- int, double are now compared no need for cast with +0
- any unusual unicode character generater from copy-paste are now cleared
- updated handling window system and more
- for/while loopBatchTime speed up when there is just operations inside.
I reached the next level with blocks, but "or" seems to not work. I now get "Unsupported binary operator OR at line 27".
Looking at Windows in your game made me think if I should make UI sections in my game re-arrangeable, but looks like something not worth the effort. What's the purpose for that "Other script Window"? It seems to not do anything, but occupy screen space.
def func():
gx = -100
gy = -100
found = False
d = 20
for xx in range(5, d):
say(xx)
for yy in range(-d, d):
if is_goal(get_pos_x()+xx, get_pos_y()+yy):
gx = get_pos_x() + xx
gy = get_pos_y() + yy
found = True
break
if found:
break
print(gx, gy)
dx = 1
if gx < get_pos_x():
dx = -1
dy = 1
if gy < get_pos_y():
dy = -1
while get_pos_x() != gx or get_pos_y() != gy:
if is_block(get_pos_x() + dx, get_pos_y()):
while get_pos_x() != gx:
print(get_pos_x(), gx)
move(dx, 0)
else:
while get_pos_y() != gy:
move(0, dy)
submit()
func()
thanks for pointing out the or functionality.
the other script is for a test run, since there is no undo/redo yet: i figured would be convinient to have a seperate window by side. also wanted to learn resize/minimizable window system.
[edit]: now boolean operations not, and, or as well as bitwise operations >> << | & ~ are supported (updated to v2.0.zip for windows)
I have beaten the game with the following code:
def func(): gx = -100 gy = -100 found = False d = 20 for xx in range(4, d): say(xx) for yy in range(-d, d): if is_goal(get_pos_x()+xx, get_pos_y()+yy): gx = get_pos_x() + xx gy = get_pos_y() + yy found = True break if found: break print(gx, gy) dx = 1 if gx < get_pos_x(): dx = -1 dy = 1 if gy < get_pos_y(): dy = -1 while get_pos_x() != gx or get_pos_y() != gy: if get_pos_x() != gx and not is_block(get_pos_x() + dx, get_pos_y()): print(get_pos_x(), gx) move(dx, 0) else: move(0, dy) submit() func()
Speaking of minor issues, I noticed that sometimes when resizing a window (specifically, enlarging), line numbers move separately from code.