Hello,
It was a long time ago that i made one of my first program's SNAKE. Now i am improving it by also making it faster. I saw that most time consuming was the graphical part of the snake program:
Pxl-On(L1(F),L2(F))
Pxl-On((L1(F))+1,L2(F))
Pxl-On(L1(F),(L2(F))+1)
Pxl-On((L1(F))+1,(L2(F))+1)
Pxl-Off(L1(G),L2(G))
Pxl-Off((L1(G))+1,L2(G))
Pxl-Off(L1(G),(L2(G))+1)
Pxl-Off((L1(G))+1,(L2(G))+1)
This code makes the head of the snake appear and deletes the tail. L1 is the list with all the x values of the snake and L2 are the Y values. Combining L1 and L2 makes a place.
I use a
94->Ymax
62->Xmax
window. I have always thought that that would be the perfect window. But this site says it must be
:104→Xmax
:72→Ymax
This code works well but its not that fast. If i wanne make a 3x3 sprite it takes me even more time to display so maybe there is a better way using text? or maybe by using lines or plots. I tryed lines but it didnt work out for me. Maybe becouse of the window. I got verry rare results.
I hope somebody can help me.
Thx