Developed with love by KnpLabs Hire us for your project!
107

snake-bundle

by dbu

The snake game implemented with the Symfony console

                             /^\/^\
                           _|__|  O|
                  \/     /~     \_/ \
                   \____|__________/  \
                         \_______      \
                                 `\     \                    \
                                  |     |                     \
 ____              _             /     /                       \
/ ___| _ __   __ _| | _____     /     /                         \\
\___ \| '_ \ / _` | |/ / _ \   /     /                           \ \
 ___) | | | | (_| |   <  __/  /     /                             \  \
|____/|_| |_|\__,_|_|\_\___| /     /             _----_            \   \
                            /     /           _-~      ~-_         |   |
                           (      (        _-~    _--_    ~-_     _/   |
                            \      ~-____-~    _-~    ~-_    ~-_-~    /
                              ~-_           _-~          ~-_       _-~   - jurcy -
                                 ~--______-~                ~-___-~

This bundle adds a command to run the snake game in your console.
It is a demo for the cursor added in Symfony Console 5.1.
Let it not distract you from your work ;-)

Installation and Usage

Installation

composer require dbu/snake-bundle

Run

bin/console game:snake

Development

Clone the git repository, then run:

composer install
./tests/fixtures/app/bin/console game:snake

FAQ

My console is looking weird after running the command

This can happen after aborting the program, e.g. with -c. Reset the console to sane defaults
by typing:

stty sane

Be aware that input is probably hidden, so you won't see anything until you hit enter.

Why Snake?

Because it was the first thing I could think of.
And its simple enough that it should be possible to follow what is going on.

What is this font?

Delta Corps Priest 1 from http://patorjk.com/software/taag/

Screenshots

start screen

lost game

Copyright (c) David Buchmann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
  • initial commit
    By dbu, 7 months ago