Introduction: CMD Snake Game

Picture of CMD Snake Game

Just one thing before we start: ZemByte does not own the rights of COMMAND PROMPT. That is owned by Microsoft. This version of snake will only work on Windows 10 or lower.

You can use the code for yourself. You cannot copy the code and post it on other platforms nor can you change the name.

Step 1: Notepad

For this project, you will need Notepad. We recommend that you use Notepad++(, as it is easier to use!

Step 1:

Open Notepad, and name it: Snake.bat

Step 2:

Save it to: All files (This is really important!)

Step 2: Copy

Step 3:

Copy and paste our code into notepad! (You will find the code at the next page!)

Step 4:

Save the code, but don't open it!

Step 5:

Make a folder, and put the Snake.bat in that folder!

Step 6:

Start the .bat file. If it opens correctly, it should make a "key" and a "cmd" .file in your folder. Do never delete them!

(It can be possible that your pc showing settings make it so you can't see the "cmd" file. Do not worry! If you can play the game like it should do, it will work fine! Do you want to see or edit the "cmd" file, then change your pc showing settings to "All files".

Step 7:

If the files do not create themselves, close the game and then restart it again!

Step 3: Code

Picture of Code

We updated our code, so you can play it on windows 10 and lower! So please download the .txt file with the code. You need to COPY this code!


antleone77 (author)2017-06-27

Everytime I open the game the cmd opens, but instantly closes itself. Please help ASAP.


ZemByte (author)antleone772017-10-23

Hey Antleone77

Please make sure you followed every step in the program.

Could you see if there is any other application that is using CMD on your device that is not a program file? You can see this in your task manager.

awesomenessg (author)2017-07-27

hey will it still work if you use a .bat to .exe converter??

ZemByte (author)awesomenessg2017-10-23

Hey Awesomenessg

Yes it will. Just note that it will not run on any other system than Windows

ZemByte (author)2017-02-17

We updated our code! Please download it again, and follow all the steps!

Lysanne_ptx (author)2016-12-01

hey, does anyone know how to change the colors? i really love the game but I think it would be nicer in different colors

Thanks <3

ZemByte (author)Lysanne_ptx2016-12-06

Hey! You can find multible lines that say: color. Change the value behind the word "color".

FunLife3315 (author)ZemByte2017-02-11

color 0a looks best :d

sizzle74 (author)2015-09-22

all I got after opening the snake.bat file was the 'key' cmd file no matter how many times i opened and reopened. when i open the 'key' file i get a cmd window for color selection for the background and text color. then its says push any key to continue and the window closes.

ZemByte (author)sizzle742015-09-22

Hey Sizzle! Good that you say it! The CMD code can be invisible on some computers (depends on your showing settings). If you can play the game, and set highscores, than it should be fine! If you still can't play, message me again!

Good luck with beating the game!

With Kind Regards,

Max, Programmer of ZemByte

sizzle74 (author)ZemByte2015-09-24

hello zem, i still can not play. im running windows 7 ultimate. i created a folder on desktop and moved (not copied) the .bat file made with notepad++ into the desktop folder. i had saved the .bat file on c: drive. what am i doing wrong? thanks for your help

adddsfff (author)sizzle742016-11-19

just rename the file "code.txt" to "snake.bat" and right click, "Run as administrator"

ZemByte (author)sizzle742015-09-27

Hey Sizzle!

We fixed the problem with the code! You can now download the code from the last page! Please copy that code, and follow the instruction from step 1 to step 7!

Sorry for this problem, good that you found it!

With special regards,

Max, Programmer of ZemByte

SaschaS14 (author)2016-06-05

I have shorter instructions:
Download the "code.txt" name it "snake.bat"
And Double Click it ;-P

ZemByte (author)SaschaS142016-09-04

It would be nice if everyone understood those steps!

Jonzy65 (author)2016-08-30

Hi is it possible to make another snake?

ZemByte (author)Jonzy652016-09-04

It is possible to program the snake in a different way, yes.

MartiA1 (author)2016-04-25

it works.thanks

ZemByte (author)2016-03-14

We updated our code! Please download the .txt file with the code. You need to COPY this code and start at STEP 1 again!

Kind regards,

All programmers of ZemByte

TheBlkSwrdzMan (author)2016-03-11

Hello, I copied the game, and followed all of the instructions. Then I opened it and it worked but I cannot move in the game, I can select different speeds and can see a key file and 'last score on Impossible' , because I was messing around. Could you help me wih theis

ZemByte (author)TheBlkSwrdzMan2016-03-13

Hey! Do you have numlock keys? If so, try clicking on the numlock keys button. Also, have you tried a different gamemode? Sometimes, the ticks on the Impossible gamemode are to high for you to move. Maybe try Fast instead!
If this does not work, please let me know.

Kind regards,

TheBlkSwrdzMan (author)2016-03-11

Hello, I copied the game, and followed all of the instructions. Then I opened it and it worked but I cannot move in the game, I can select different speeds and can see a key file and 'last score on Impossible' , because I was messing around. Could you help me wih theis

Romyr John AndreiP (author)2015-12-04

hello development team! i would like to report a problem that occurred whilst opone ening the screen went on the dreaded blue screen after creating the key file.can anyone help me about this problem?

Hey Romyr John AndreiP!

Your PC should automatically make a key.txt file after opening the snake.bat file. This file should delete itself after closing. Did you open the key.txt file?

If you did not open the key.txt file, it is a problem in our code, and we will check it as soon as we can!

Make sure you followed every step, and make sure you are either running: Windows 7, Windows 8 or Windows 10.

What is turning blue? Your entire screen, or the CMD screen?

Please let me know!

Kind regards,

Niels, Main Media Manager of ZemByte.

(Be sure to look at our website )

What you could do is send us an email with your problem + screenshots! If you send an email to today, we will put you first in the queue so you can be helped immediately!

AboudA1 (author)2015-10-08

how do I pick a speed ?

I tried to press all the numbers on the keyboard but nothing happened

ZemByte (author)AboudA12015-10-08

Hey Aboud!

Did you try the numlock keys? And did you select the cmd program?

Kind regards,

Max, programmer of ZemByte

AboudA1 (author)ZemByte2015-10-08

I don't have any numlock keys on my keyboard

ZemByte (author)AboudA12015-10-09

Hey Aboud.

Then a few thing can be wrong. Could you please tell us what you see? Thank you!

Kind regards,

Max, programmer of ZemByte

AboudA1 (author)ZemByte2015-10-09

I see this:

the process cannot access the file because it is being used by another process.

ZemByte (author)AboudA12015-10-13

Hey aboud!

Make sure you are not using cmd while you play the snake game. You can do this by restarting your pc, or by restarting cmd in your task manager. Also make sure you follow every step!

Kind regards,
Max, programmer of ZemByte.

seth hettinga (author)2015-09-23

Uuhm hoe doe ik het met mac xD

ZemByte (author)seth hettinga2015-09-23

Hey Seth!

I'm really sorry. But you will need CMD for this snake game. And CMD is owned by Microsoft! But do not worry! We are trying to make a Terminal version! Be sure to look for new Instructables on our page!

seth hettinga (author)ZemByte2015-09-23

Thanks ZemByte!

About This Instructable



Bio: ZemByte is a development company. We make games, operating systems and more!
More by ZemByte:Java Programming 2 | How to work with Eclipse (Java)CMD Snake GameJava Programming 1 | Rock, Paper and Scissors
Add instructable to: