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
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 04:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy