From d3a0cc3a8ba6dfeb64d3faeffdeb6845b60e5840 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 20 Jan 2018 15:41:49 +0100 Subject: rearranged the dir for github - removed tools and pdfs - rearranged the projects dirs - added md files - other minor changes --- projects/10/Square/SquareGameT.xml | 315 ------------------------------------- 1 file changed, 315 deletions(-) delete mode 100644 projects/10/Square/SquareGameT.xml (limited to 'projects/10/Square/SquareGameT.xml') diff --git a/projects/10/Square/SquareGameT.xml b/projects/10/Square/SquareGameT.xml deleted file mode 100644 index 3136af2..0000000 --- a/projects/10/Square/SquareGameT.xml +++ /dev/null @@ -1,315 +0,0 @@ - - class - SquareGame - { - field - Square - square - ; - field - int - direction - ; - constructor - SquareGame - new - ( - ) - { - let - square - = - Square - . - new - ( - 0 - , - 0 - , - 30 - ) - ; - let - direction - = - 0 - ; - return - this - ; - } - method - void - dispose - ( - ) - { - do - square - . - dispose - ( - ) - ; - do - Memory - . - deAlloc - ( - this - ) - ; - return - ; - } - method - void - moveSquare - ( - ) - { - if - ( - direction - = - 1 - ) - { - do - square - . - moveUp - ( - ) - ; - } - if - ( - direction - = - 2 - ) - { - do - square - . - moveDown - ( - ) - ; - } - if - ( - direction - = - 3 - ) - { - do - square - . - moveLeft - ( - ) - ; - } - if - ( - direction - = - 4 - ) - { - do - square - . - moveRight - ( - ) - ; - } - do - Sys - . - wait - ( - 5 - ) - ; - return - ; - } - method - void - run - ( - ) - { - var - char - key - ; - var - boolean - exit - ; - let - exit - = - false - ; - while - ( - ~ - exit - ) - { - while - ( - key - = - 0 - ) - { - let - key - = - Keyboard - . - keyPressed - ( - ) - ; - do - moveSquare - ( - ) - ; - } - if - ( - key - = - 81 - ) - { - let - exit - = - true - ; - } - if - ( - key - = - 90 - ) - { - do - square - . - decSize - ( - ) - ; - } - if - ( - key - = - 88 - ) - { - do - square - . - incSize - ( - ) - ; - } - if - ( - key - = - 131 - ) - { - let - direction - = - 1 - ; - } - if - ( - key - = - 133 - ) - { - let - direction - = - 2 - ; - } - if - ( - key - = - 130 - ) - { - let - direction - = - 3 - ; - } - if - ( - key - = - 132 - ) - { - let - direction - = - 4 - ; - } - while - ( - ~ - ( - key - = - 0 - ) - ) - { - let - key - = - Keyboard - . - keyPressed - ( - ) - ; - do - moveSquare - ( - ) - ; - } - } - return - ; - } - } - -- cgit v1.2.3