Home
Man
Search
Today's Posts
Register

BSD, Linux, and UNIX shell scripting Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Tetris Game -- based on a shell script (new algorithm)

Tags
shell, shell scripts, tetris, unstuck

Login to Reply

 
Thread Tools Search this Thread
# 64  
Old 07-16-2013
Awesome script!
# 65  
Old 12-30-2015
Tetris Game -- based on a shell script (new algorithm)

Hello,

Thanks for this wonderful Game and code, I'm a newbie to Unix and Shell Scripting, Can you please let me know how can get this script running, are there any installation steps? and i dont have root rights on my server.

Please advise!!

Thanks!!
# 66  
Old 12-30-2015
Quote:
Originally Posted by Mahesh_RPM
Can you please let me know how can get this script running, are there any installation steps? and i dont have root rights on my server.
Just copy the scripts source code and save it as a regular text file, set execution rights and execute it. For example:

Save source text to file "mytetris", then:

Code:
$ chmod 754 ./mytetris
$ ./mytetris

I hope this helps.

bakunin
# 67  
Old 12-31-2015
Hello, I'm getting below errors

Code:
[pvuser@sz1270 scripts]$ ./tetris.sh

     ----------------[Time 00:00:00:01]----------------
sleep: bad character in argument=======================||       []  []      []          []  []        []      [][][]  []      []
sleep: bad character in argument                       ||     []  []  []      []          []            []        []  []    [][][]
sleep: bad character in argument                       ||                       []      []  []                [][][][][]      []
sleep: bad character in argument                       ||                                                     []  []
sleep: bad character in argument                       ||                                                     []  [][][]
sleep: bad character in argument                       ||
sleep: bad character in argum  t                       ||
sleep: bad character in arg  []                        ||
sleep: bad character in arg[][][]                      ||
sleep: bad character in argum  t                       ||   RunLevel       PreviewLevel   SpeedLevel         ScoreLevel
sleep: bad character in arg  []                        ||   31             6              0                  0
sleep: bad character in arg[][][]                      ||
sleep: bad character in argum[]t                       ||   M|m      ===   double         N|n          ===   half
sleep: bad character in argum  t                       ||   Q|q|ESC  ===   exit           U|u          ===   one step up
sleep: bad character in arg  []                        ||   P|p      ===   pause          S|s|down     ===   one step down
sleep: bad character in arg[][][]                      ||   R|r      ===   resume         A|a|left     ===   one step left
sleep: bad character in argum[]t                       ||   W|w|up   ===   rotate         D|d|right    ===   one step right
sleep: bad character in argument                       ||   T|t      ===   transpose      Space|enter  ===   drop all down
sleep: bad character in argum  t                       ||
sleep: bad character in arg  []                        ||   Tetris Game  Version 7.1.4
sleep: bad character in arg[][][]                      ||   YongYe <complex.invoke@gmail.com>
sleep: bad character in arg00:00:00:02                 ||   11/01/2011 BeiJing China [Updated 12/01/2013]
sleep: bad character in argument                       ||                                                                  [][][]
sleep: bad character in argument                       ||   Algorithm:  [][][]                                         [][][][]
sleep: bad character in argument                       ||               []                  [][][]                         [][]
sleep: bad character in argument                       ||   [][] [][]   []  [][][][]  [][][][][]    [][]             [][]  []   [][] [][]
sleep: bad character in argument]                      ||   [] row []   []  [] (x-m)*zoomx  [][]    []  cos(a) sin(a)  []  []   []  m  []
sleep: bad character in argum[]t                       ||   []     [] = []  []              []   *  []                 []  [] + []     []
sleep: bad character in argument                       ||   [] col []   []  [] (y-n)*zoomy  []      [] -sin(a) cos(a)  []  []   []  n  []
sleep: bad character in argument                       ||   [][] [][]   []  [][][][]  [][][][]      [][]             [][]  []   [][] [][]
sleep: bad character in argument                       ||               []                                                 []
sleep: bad character in argum  t=======================||               [][][]                                         [][][]
sleep: bad character in arg  []
sleep: bad character in arg[][][]
sleep: bad character in argum  t
sleep: bad character in arg  []
sleep: bad character in arg[][][]
sleep: bad character in argum[]t
sleep: bad character in argument
sleep: bad character in argument
sleep: bad character in argument
sleep: bad character in argument
sleep: bad character in argument
sleep: bad character in argum  t
sleep: bad character in arg  []
sleep: bad character in arg[][][]
sleep: bad character in argum[]t
sleep: bad character in argument
sleep: bad character in argument
sleep: bad character in argument
sleep: bad character in argument
sleep: bad character in argument
sleep: bad character in argument

i tried passing some arguments which didnt solve the issue,
# 68  
Old 12-31-2015
Try downloading the tarball, or make sure you copy-pasted everything (within the code block) from the first page.
Runs well on my machine.

If you run it it sh ./scriptname, and if it still fails, what is the output of:
Code:
ls -l /bin/sh

, if its redirecting somewhere else than bash, you'll need to call the script using:
Code:
bash ./scriptname

hth
# 69  
Old 12-31-2015
It seems to use a floating point e.g. 0.1 for sleep; that works only with GNU sleep.
# 70  
Old 04-25-2016
WOW amazing! i'll try to learn from it
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Creating a text based game using shell script. Othmane Shell Programming and Scripting 3 12-08-2017 11:07 AM
Proper distribution of cards in terminal based crazy8's game in bash script cogiz Shell Programming and Scripting 2 11-13-2016 07:17 PM
Understanding Tetris-game code. newbie xcod3r Shell Programming and Scripting 0 03-19-2016 02:40 PM
[Solved] Making a text based game murphy UNIX for Dummies Questions & Answers 2 06-06-2013 11:35 AM
Tetris Game in C++ complex.invoke Programming 0 02-20-2013 06:39 AM
Shell Text Based Game, This Error Makes NO sense. Please help lemonoid Shell Programming and Scripting 3 11-17-2012 03:06 AM
Making a Text based game. Need help. lemonoid Shell Programming and Scripting 1 11-07-2012 04:13 PM
Is there picture based game under linux terminal? vistastar UNIX for Dummies Questions & Answers 18 09-02-2011 01:57 AM
text based football game? dadoprso UNIX for Dummies Questions & Answers 1 04-22-2010 01:32 PM
Shell Script Poker Game earnstaf Shell Programming and Scripting 8 03-11-2008 12:46 PM


All times are GMT -4. The time now is 08:35 PM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password