Sponsored Content
Full Discussion: Snake and ladder game
Top Forums Shell Programming and Scripting Snake and ladder game Post 302837409 by Chubler_XL on Thursday 25th of July 2013 05:46:43 PM
Old 07-25-2013
Are you planning on drawing the board with ASCII art?

The snakes are quite challenging to get looking nice,
but the ladders look OK IMO, if you only go straight up with them:

Code:
+------------------------------
|    |    |    |    |    |    |   
| 25 | 26 | 27 | 28 | 29 | 30 |    
|    |    |  v |    | |-||    |    
|----+----+--#-+----+-|-|+----|
| /==========} |    | |-||    |    
| 24 | 23 | 22 | 20 | 20 | 19 |    
|    |    |    |    |    |    |
|----+----+----+----+----+----|

---------- Post updated at 07:46 AM ---------- Previous update was at 07:08 AM ----------

Or course if you have a terminal that supports unicode characters (e.g. uxterm) you can improve things a fair bit:

Code:
┌────┬────┬────┬────┬────┬────┐
│    │    │    │    │    │    │    
│ 25 │ 26 │ 27 │ 28 │ 29 │ 30 │    
│    │    │  v │    │ ╠═╣│    │    
├────┼────┼───┼────┼─╠═╣┼────┤
│  ══════════╝ │    │ ╠═╣│    │  
│ 24 │ 23 │ 22 │ 20 │ 20 │ 19 │    
│    │    │    │    │    │    │
├────┼────┼────┼────┼────┼────┤


Last edited by Chubler_XL; 07-25-2013 at 06:53 PM..
 

4 More Discussions You Might Find Interesting

1. What is on Your Mind?

Game: Name this person

Simple rules... 1. Guess who it is, the first person to get it posts the next picture, post your guess as a reply to this thread. 2. Wait for the person who posted the picture to confirm that you are correct before posting a new picture. 3. If the person who posted the picture does not answer... (268 Replies)
Discussion started by: reborg
268 Replies

2. Programming

Tetris Game in C++

Open Source Project: https://github.com/yongye/cpp Ported from the shell: Shell (0 Replies)
Discussion started by: complex.invoke
0 Replies

3. What is on Your Mind?

Snake game challenge in UNIX

Hey Guys, I have made this basic snake game but it a little bit different from conventional snake game. Learned some basics of Unix. Hope you enjoy playing it. Please download and run on your machine and suggest any changes i can make. and let me know if someone could score 1000 points ;) ... (2 Replies)
Discussion started by: amit14august
2 Replies

4. UNIX for Beginners Questions & Answers

Word ladder Problem

Perl - Script Rules In a Word Ladder: Players get a starting word and an ending word Starting and ending words must be the same length (PIG and HOG, or CAT and DOG) Players change one letter at a time, attempting to move from the starting word to the ending word Each intermediate step... (1 Reply)
Discussion started by: asak
1 Replies
SNAKE4(6)							   Games Manual 							 SNAKE4(6)

NAME
snake4, snake4scores - Game starring a fruit-eating snake. SYNOPSIS
snake4 [-hHV] [-M file] [--help] [--highscores] [--version] [--merge-highscores=file] snake4scores DESCRIPTION
The snake4 program is my fourth implementation of the snake game, written for Unix and X11. Previous versions were written for MS-DOS. Move the snake around the screen and eat food. The snake grows in length as you eat. Avoid hitting the fence, eating lethal mushrooms and rotten food, and biting your own tail. Now and then a slim-pill will bounce around. If you eat this, you will get shorter, and you will gain bonus points for every length you loose. The bonus is also given when a round is over. When food starts blinking, it's about to rot. Rotten food is poisonous, and thus uneatable. As long as it blinks, it can still be eaten. Oh, yes - I almost forgot: You may be visited by the evil headbanger. Take my advice and run away from him before he hits you in the head! He won't stay long. The keys used to control the game are given at startup. snake4 features a site-wide highscore file. The file contains the top 200 users. Each user may appear once only in the highscore table. For technical reasons, snake4 connects to the X11 server before parsing options. This makes it impossible to eg. browse the highscore table using -H if no server is available. To be able to see the scores in such a case, snake4scores produces the same output as snake4 with option -H, but does no attempt on connecting to the X11 server. OPTIONS -h, --help Print a usage message on standard output, and exit successfully. -H, --highscores Dump the highscore list to standard output, and exit successfully. Starting snake4 with the name snake4score does the same thing, without first connecting to the X11 server. Note that this will possibly print more entries than the 20 or so that will fit within the game startup screen. -V, --version Print version information on standard output, then exit successfully. -M, --merge-highscores=file Merge separate highscore file file into the default highscore file, and exit successfully. Displays the new highscore table. This option is for the game owner or root only. X11 OPTIONS In addition to the above mentioned options, snake4 accepts the standard X11 toolkit options. AUTHOR
Sverre H. Huseby <shh@thathost.com>. 11 October 1996 SNAKE4(6)
All times are GMT -4. The time now is 12:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy