瀏覽代碼

added readme

tarfeef101 6 年之前
父節點
當前提交
c213bad889
共有 3 個文件被更改,包括 26 次插入2 次删除
  1. 23 1
      assignments/a1/a1.md
  2. 二進制
      assignments/a1/snake
  3. 3 1
      assignments/a1/snake.cc

+ 23 - 1
assignments/a1/a1.md

@@ -1 +1,23 @@
-# A1
+
+# CS 349 A1 - X Windows Snake
+
+This is a simple snake app built off of x windows and c++. Control the snake to eat the fruit and grow, and avoid hitting the walls and yourself!
+
+## Getting Started
+**Controls**
+
+ - Arrow Keys - turn the snake
+ - Spacebar - pause the game
+ - q - quit the game
+ - r - restart the game
+
+## Deployment
+
+Run the snake executable, with optional arguments (both or neither)
+
+ - FPS: Frames Per Second (defaults to 60)
+ - Speed: integer between 1 and 10 (defaults to 5)
+
+## Authors
+
+* **Tareef Dedhar** - *Initial work* 

二進制
assignments/a1/snake


+ 3 - 1
assignments/a1/snake.cc

@@ -678,10 +678,12 @@ int main (int argc, char * argv[])
   {
     FPS = atoi(argv[1]);
     velocity = atoi(argv[2]);
+    if (atoi(argv[2]) < 1 || atoi(argv[2]) > 10) goto BADARGS;
   }
   else
   {
-    printf("you're shit\n");
+    BADARGS:
+    printf("Incorrect arguments supplied\n");
     exit(0);
   }