Home Man
Today's Posts

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)

shell, shell scripts, tetris, unstuck

Login to Reply

Thread Tools Search this Thread
# 15  
Old 01-09-2012
I'm always amazed when people do great things with shell scripting. I like to challenge myself to strict shell programming rather than installing third party languages. Good job!
# 16  
Old 01-09-2012
I got it working on my powerbook (G4 1.67Ghz..) with bash and macOSX10.5.6 though a bit buggy.. but display quite some funny figures! Look to me it will be hard work to debug because of the figures produced...
# 17  
Old 01-09-2012
I figured cos(a) sin(a) and friends are the transformations, but they were displaying in the playing area. Thanks to Corona, however, it renders correctly now, that I changed the font size to smaller font -- it must have been overflowing the lines in my terminal.

Although it still has some bugs (sometimes blocks rotate when I try to push them into a cavity from the side, pressing left/right arrow), it is a major work of art and you have my admiration for both the effort and the technical realization. Bravo.
# 18  
Old 01-09-2012
Originally Posted by Corona688
Your choice of pieces makes the game unwinnable but it's still fun for that
Please have a good look at my reply located in #9
# 19  
Old 01-09-2012
On AIX 6.1, its tricky also: doesnt like the sleep values for a start... and to get it display correctly your xterm should have 145x45 size,
# 20  
Old 01-09-2012
Using bash's read builtin for timeouts with read -t may be a more portable way to do timeouts than sleep 0.03. If a system has an actual bash shell, read -t ought to work.

You could also do finicky terminal strangeness by setting read timeouts on the terminal itself with stty.
# 21  
Old 01-09-2012
It works for me in RHEL 5, but not in RHEL 4. :/

Nonetheless, it's an awesome work.

Edit: These are the versions I'm using:
# Does NOT work here
[verdepollo@atlas ~]$ cat /etc/redhat-release && bash --version
Red Hat Enterprise Linux AS release 4 (Nahant Update 8)
GNU bash, version 3.00.15(1)-release (i686-redhat-linux-gnu)
Copyright (C) 2004 Free Software Foundation, Inc.

# Works flawlessly here:
[root@eve tmp]# cat /etc/redhat-release && bash --version
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

Edit 2: Also, it seems to work only when using GNU sleep.

Last edited by verdepollo; 01-09-2012 at 02:04 PM.. Reason: Add version details
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 10:07 AM
Proper distribution of cards in terminal based crazy8's game in bash script cogiz Shell Programming and Scripting 2 11-13-2016 06:17 PM
Understanding Tetris-game code. newbie xcod3r Shell Programming and Scripting 0 03-19-2016 01:40 PM
[Solved] Making a text based game murphy UNIX for Dummies Questions & Answers 2 06-06-2013 10:35 AM
Tetris Game in C++ complex.invoke Programming 0 02-20-2013 05:39 AM
Shell Text Based Game, This Error Makes NO sense. Please help lemonoid Shell Programming and Scripting 3 11-17-2012 02:06 AM
Making a Text based game. Need help. lemonoid Shell Programming and Scripting 1 11-07-2012 03:13 PM
Is there picture based game under linux terminal? vistastar UNIX for Dummies Questions & Answers 18 09-02-2011 12:57 AM
text based football game? dadoprso UNIX for Dummies Questions & Answers 1 04-22-2010 12:32 PM
Shell Script Poker Game earnstaf Shell Programming and Scripting 8 03-11-2008 11:46 AM

All times are GMT -4. The time now is 08:47 AM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
Show Password