소스 검색

food now lies in line with the snake, but randomness doesn't quite seem random...

tarfeef101 6 년 전
부모
커밋
8fcf1230e7
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. BIN
      assignments/a1/snake
  2. 2 2
      assignments/a1/snake.cc

BIN
assignments/a1/snake


+ 2 - 2
assignments/a1/snake.cc

@@ -86,8 +86,8 @@ class Fruit : public Displayable
 
     void newspot()
     {
-      x = (rand() % 800);
-      y = (rand() % 600);
+      x = (rand() % 32) * 25;
+      y = (rand() % 24) * 25;
     }
         // ** ADD YOUR LOGIC **
         /*