• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

AttribH A D27-May-20031.8 KiB5437

IconH A D27-May-20031.9 KiB3534

MakefileH A D03-May-20221 KiB3115

MeistaH A D27-May-20033.8 KiB10985

NEWSH A D18-Jun-20091.1 KiB2923

NotesH A D27-May-20031.1 KiB2722

PortingH A D27-May-20032.2 KiB9076

READMEH A D01-Jun-20068.5 KiB210170

ScoreH A D27-May-2003183 106

TestimonialH A D05-Jun-200945.7 KiB1,068917

game.cH A D18-Jun-20099.6 KiB302215

game.hH A D01-Jun-20062 KiB4819

pieces.hH A D27-May-20031.1 KiB2910

pieces3.cH A D27-May-20031.7 KiB7652

pieces4.cH A D27-May-20032 KiB8460

pieces5.cH A D27-May-20035 KiB185148

pieces7.cH A D27-May-20033.4 KiB140108

screen.cH A D03-May-202214.3 KiB432232

screen.hH A D01-Jun-20061.7 KiB4623

tt.6H A D15-Mar-20093.8 KiB127125

tt.cH A D03-May-202217.3 KiB527364

tt.hH A D03-May-20228.8 KiB19487

utils.cH A D03-May-20229 KiB286145

utils.hH A D18-Oct-2005835 215

README

1Tetris for Terminals - "tt" - Written by Mike Taylor
2====================================================
3
4(1)  Specification
5==================
6
7	This is a game written in C for Berkeley and System V UNIX
8	machines.  It was written on a Sun4 and has been extensively
9	played and tested on both this machine and a Sun3, both
10	running SunOS 4.0.1, a Berkeley 4.3bsd-derived UNIX, but it
11	should port with minimum difficulties to any Berkeley UNIX.
12	It has also been ported to SCO Unix System V/386 3.2.2, and
13	should therefore be portable to other System V UNIX systems.
14	One potential difficulty to look out for is incompatibility of
15	the high-score file between different architectures, (eg.
16	sun3 and sun4). I've done all I can to make it work, but there
17	are no guarantees, and you might be better compiling multiple-
18	architecture "tt"s with different high-score tables.
19
20(2)  Compilation
21================
22
23	The Makefile as included should be pretty much applicable
24	anywhere.  Simply edit the file "tt.c" to give the pathname of
25	the file you want to use for the high-score table
26	(SCORE_FILE), and unless you are using the LOCKF #definition
27	(in tt.h), the file you want to use as a lock for this table
28	(LOCK_FILE, which should be in a publicly writeable
29	directory).  If your machine is running System V or a similar
30	UNIX, then you should make sure that CFLAGS (see the Makefile)
31	contains the flag -DSYSV.
32
33	Note that if you're on a System V Unix, you should add
34	-DNO_NAP_SYSCALL to CFLAGS if you do not have the nap(S)
35	system call.  Try looking for it in the -lx library.  If you
36	don't have the usleep() system call on BSD Unix, then add
37	-DNO_USLEEP_SYSCALL to CFLAGS.
38
39	Now type "make".  The program will be compiled, producing a
40	binary called "tt".  This can then be moved to a bin directory
41	if required.
42
43(3) Acknowledgements
44====================
45
46	The game Tetris was apparently designed by "a Russian
47	Researcher".  Sadly, history, or at least the version of it
48	that I heard, does not record his name, and it seems that the
49	poor frog-head not only made no money from his brilliant idea,
50	but also didn't get any fame.  'S'sad.	Still, I credit him
51	with the original idea, whoever he may be.
52
53	The inspiration for this program came from two recently-posted
54	versions of Tetris, both of which run on Sun workstations
55	only.  There are a few of these around here, but many people
56	have no access to them.	 I wrote this version so that everyone
57	could play.  It's the communist in me :-)
58
59	The program design, planning (hah!), coding, and so on for
60	this version was all done entirely by me, (Mike Taylor), and
61	very smug I am about it, too.  The only exception to this is
62	that the game-levels were accidentally co-invented by James
63	"root@weed" Beckett, by pressing the space-bar too many times.
64
65	Play-testing, which has been extensive even now, less than a
66	week after I started writing, has been by many people, but
67	special mention goes to Paul Metcalfe, Kenton Oatley, Harvey
68	"Max" Thomson and Paul "Freddy" Capper.	 No mention *at all*,
69	not even this one, goes to Mike "Sunny" Lessacher, who claims
70	not to like Tetris.  ("Not like Tetris?	 What does that
71	mean?" :-)
72
73	All documentation is also by me.
74
75Update: Thu Jul  5 16:04:21 BST 1990
76
77	I've added a bug-fix supplied by Boris Lucre Goldowsky
78	(boris@edu.rochester.psych.prodigal), so that the program now
79	correctly chooses where to drop pieces at the beginning of
80	games on high levels -- thanks, Boris!
81
82Update: Thu May 16 15:16:15 PDT 1991
83
84	Harvey Thompson (harveyt@santa-cruz.co.uk) really did all the
85	work for System V portability (fingers crossed that nap(S) is
86	actually a standard system call).
87
88Update: Thu Jun  1 08:34:20 BST 2006 (Yes, fifteen years later)
89
90	Ryan Jud Hughes (rjhughes@umich.edu) contributed code and
91	documentationfor two nice new features: -g displays "ghost"
92	pieces that show where the current piece would fall if
93	dropped, and -N shows the next piece in the spare right-side
94	area.
95
96(4) The Legal Position
97======================
98
99	Look, I'm sorry, I *know* this bit is dull, but it has to be
100	done, and it saves time and trouble for everyone if we just
101	get on with it.	 here we go:
102
103		The program "tt", its visual appearance, its code, its
104		documentation, etc., are the intellectual property of
105		Mike Taylor.  The program may be freely distributed,
106		copied, modified, re-posted or whatever PROVIDED that
107		the authorship and ownership remains clear, and that
108		no-one makes any money from it without me knowing (and
109		taking a hefty cut!)  Whoops, that's spoilt the
110		official feel to it.  Never mind, you get the idea.
111		Do what you want provided it isn't sneaky.
112
113(5) The Game
114============
115
116	Tetris is one of those simple-but-compulsive games that you
117	persistently find yourself wanting to play "just once more".
118	I know, I know what you're thinking, "We've all heard that
119	before!", but it just happens to be true on this occasion.
120	The object of the game is simply to prevent a stack of blocks
121	from building up to the top of the play-area, (to the left of
122	the screen).  You do this by rotating and shifting the blocks
123	as they fall, in such a way as to make them fit together as
124	well as possible at the bottom.	 If you manage to complete a
125	whole line, from right to left, then that row will disappear,
126	and all the rows above will fall down into its place.  it is
127	possible to get more than one row at once, and it is a
128	wonderful feeling to get four at once!
129
130	There are five types of block, (seven if you count mirror
131	images), each of which is made up of four squares stuck
132	together, (hence "Tetris", I assume).  These pieces score
133	different numbers of points based on how difficult or
134	otherwise it is to fit them into the place required.  The
135	pieces are:
136
137		  ######	"T-shape"		1 point.
138		    ##
139
140		<><><><>	"Long one"		2 points.
141
142		()	{}
143		()	{}	"L-shapes"		3 points.
144		()()  {}{}
145
146		  [][]		"Square"		4 points.
147		  [][]
148
149		%%	@@	"S-shapes"		5 points.
150		%%%%  @@@@
151		  %%  @@
152
153	Once a piece has been positioned where you want it, it can be
154	dropped into place immediately.	 There are no extra points for
155	this, 'cos I think it would spoil the purity of the scoring
156	system; it just speeds up the game.
157
158	Hehehe, that reminds me, as the game progresses, it very very
159	gradually speeds up, until, at scores of around 3000, it gets
160	very difficult indeed ...  I mean *very* difficult!
161
162	The keys that control the pieces, and other special keys
163	(those used to Quit or Pause the game, or Refresh the screen)
164	are shown on the screen.  They can be re-defined (except the
165	Refresh key), as explained in the manual page.
166
167(6)  Basic Hints
168================
169
170	Obviously, the aim is to keep the stack low, so at all times,
171	you should be on the lookout for ways to fit the currently-
172	falling piece onto those that have already fallen in such a
173	way as to complete rows.  Removing rows is the key to success.
174
175	However, if a lower section of the screen gets hopelessly
176	hole-ridden, it is sometimes best to forget about it, and
177	concentrate on building complete rows higher up, as this can
178	often be the best way to make the holes lower down become
179	available again.  A good player can take over from a game 2/3
180	full of badly-packed pieces, and eventually wrestle it right
181	back down to ground level again.
182
183	Finally, there is a tendency among beginners to leave long,
184	thin gaps down the sides of the screen, praying for a "Long
185	one" to slide down it -- it is, of course, at precisely these
186	times that a succession of S-shapes, all of the same
187	handedness, comes pouring down the screen.  The moral is
188	two-fold: (1) Beware of allowing such a situation to build up
189	in the first place, it often isn't necessary, and (2), learn
190	how to remove layers from higher up the screen with non-long
191	pieces, so your screen doesn't fill up while you wait for that
192	magical "Long one".
193
194(7)  What to do if you don't like it
195====================================
196
197	Email me at the following address: mirk@uk.co.ssl
198	In fact, email me if you *do* like it.	Email me with
199	bouquets, brickbats, bugs, baboons, bachelors, blueberries,
200	boathouses, er ... um, sorry, I seem to have got a bit carried
201	away.  Anyway, the point is, let me know what you think of
202	"tt", and it might just influence the next version.  Also, I
203	am pretty good at replying to mail!
204
205	That's it -- have fun!
206______________________________________________________________________________
207Mike Taylor - {Christ,M{athemat,us}ic}ian ...  Email to: mirk@uk.co.ssl
208     "Imagine the universe perfect and whole and beautiful.  Then be sure
209	of one thing: God has imagined it quite a bit better than you"
210