Unix/Linux Go Back    


Shell Programming and Scripting 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 Programming and Scripting


Tags
shell, tetris

Reply    
 
Thread Tools Search this Thread Display Modes
    #15  
Old Unix and Linux 01-09-2012
acidplasm acidplasm is offline
Registered User
 
Join Date: Jan 2012
Last Activity: 9 January 2012, 11:21 AM EST
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
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!
Sponsored Links
    #16  
Old Unix and Linux 01-09-2012
vbe's Unix or Linux Image
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 26 September 2017, 11:40 AM EDT
Location: Switzerland - GE
Posts: 6,460
Thanks: 284
Thanked 549 Times in 511 Posts
Neo,
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...
Sponsored Links
    #17  
Old Unix and Linux 01-09-2012
mirni mirni is offline
Registered User
 
Join Date: Mar 2011
Last Activity: 15 August 2015, 3:18 AM EDT
Posts: 686
Thanks: 51
Thanked 178 Times in 171 Posts
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 Unix and Linux 01-09-2012
complex.invoke's Unix or Linux Image
complex.invoke complex.invoke is offline
Registered User
 
Join Date: Nov 2009
Last Activity: 17 August 2017, 7:42 PM EDT
Location: BeiJing China
Posts: 236
Thanks: 6
Thanked 29 Times in 8 Posts
Quote:
Originally Posted by Corona688 View Post
Your choice of pieces makes the game unwinnable but it's still fun for that Linux
Please have a good look at my reply located in #9
Sponsored Links
    #19  
Old Unix and Linux 01-09-2012
vbe's Unix or Linux Image
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 26 September 2017, 11:40 AM EDT
Location: Switzerland - GE
Posts: 6,460
Thanks: 284
Thanked 549 Times in 511 Posts
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,
Attached Files
File Type: doc tetris01.doc (44.5 KB, 27 views)
Sponsored Links
    #20  
Old Unix and Linux 01-09-2012
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 25 September 2017, 6:50 PM EDT
Location: Saskatchewan
Posts: 22,424
Thanks: 1,127
Thanked 4,242 Times in 3,921 Posts
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.
Sponsored Links
    #21  
Old Unix and Linux 01-09-2012
verdepollo's Unix or Linux Image
verdepollo verdepollo is offline
Registered User
 
Join Date: Mar 2010
Last Activity: 18 July 2017, 2:01 PM EDT
Location: Mexico
Posts: 725
Thanks: 11
Thanked 105 Times in 102 Posts
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:

Code:
# 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
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
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
calling 'n' number of shell scripts based on dependency in one shell script. shashi369 Shell Programming and Scripting 1 11-03-2009 04:31 PM
Need to Write Shell Script based off of this shell command Rally_Point Shell Programming and Scripting 3 06-10-2009 05:19 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 01:59 PM.