Code Monkey home page Code Monkey logo

snake's Introduction

Snake

This program is a Game called "Snake" (Version 1.1). It is written is C

New In This Update: First of all, The Program prints the Main Menu of the game, in addition to an explanation of the rules of the game.

After the Player has chosen a difficulty for the current game, the board is displayed on the screen for the Player to see. (Including with the Starting Food, and the Snake which is facing to the Right! :) ). At this stage of the game, the Program expects an Input from the Player. Once the Player hits a key (UP / DOWN / RIGHT / LEFT / ESC), The game starts and the Snake starts to move constantly in the direction that it has been instructed to by the Player (In case of an arrow). In case of ESC, The For any other key, the Program does nothing.

The Snake will move in the same direction that was instructed by the Player, Until a new arrow had been hit (with a different direction). If the Snake eats the Food (which is indicated with '$'), It grows by 1 in Size, and a new piece of Food appears on the Screen.

The Goal of the game : "eat" 10 pieces of Food. When the Player succeeds, an appropriate message would be printed on the screen. If the Player (the Snake) had hit itself, or had hit a wall, Or the Player had hit the ESC button on the keyboard, The game will instantly end with a defeat (The Player had Lost). (And an appropriate message will be printed on the screen for the Player).

When a game ends, after the approriate message had been printed, the Program asks the Player whether or not he wants to play again. If the Player inserted 'y', the Main Menu will appear again, and the Player can play the game again. If the Player inserted 'n', the Program will End. Good Luck !!

ASSUMPTIONS: The Player inserts 'y' or 'n' at the end, and a number in the choices at the Main Menu.

snake's People

Contributors

liorkgow avatar

Watchers

 avatar

snake's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.