The cletris Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cletris Reference Manual

This is the cletris Reference Manual, version 0.9.0, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:30:24 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Cletris

License MIT GitHub version

Master :

Develop:

This is the classic Tetris game in Common Lisp.

Required softwares

You will need :

and dependencies :

$ sudo apt-get install libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev

Installation

Commands

Available commands :

Screenshots

0.3

Development

Support / Contribute

See here

Changelog

A changelog is available here.

License

See LICENSE.

Contact

Nicolas Lamirault nicolas.lamirault@gmail.com


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cletris

Maintainer

Nicolas Lamirault <nicolas.lamirault@gmail.com>

Author

Nicolas Lamirault <nicolas.lamirault@gmail.com>

License

MIT License

Description

A tetris game.

Version

0.9.0

Dependencies
Source

cletris.asd (file)

Component

src (module)


Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Previous: , Up: Modules   [Contents][Index]

3.1 cletris/src

Parent

cletris (system)

Location

src/

Components

Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 cletris.asd

Location

cletris.asd

Systems

cletris (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 cletris/src/package.lisp

Parent

src (module)

Location

src/package.lisp

Packages

cletris


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.3 cletris/src/specials.lisp

Dependency

package.lisp (file)

Parent

src (module)

Location

src/specials.lisp

Exported Definitions

*debug* (special variable)

Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

4.1.4 cletris/src/cletris.lisp

Dependency

specials.lisp (file)

Parent

src (module)

Location

src/cletris.lisp

Exported Definitions

cletris (function)

Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 cletris

A Tetris game.

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Special variables

Special Variable: *debug*

When T, active some logs for debugging.

Package

cletris

Source

specials.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Functions

Function: cletris USERNAME &optional GAME

Start a new Tetris game.
USERNAME could be used for the user name in a network session.

Package

cletris

Source

cletris.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Constants

Constant: +background+
Package

cletris

Source

specials.lisp (file)

Constant: +blocks+
Package

cletris

Source

specials.lisp (file)

Constant: +game-left-corner-x+
Package

cletris

Source

specials.lisp (file)

Constant: +game-left-corner-y+
Package

cletris

Source

specials.lisp (file)

Constant: +height+

The default height.

Package

cletris

Source

specials.lisp (file)

Constant: +matrix-background+
Package

cletris

Source

specials.lisp (file)

Constant: +width+

The default width.

Package

cletris

Source

specials.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.2 Special variables

Special Variable: *cletris-directory*

Directory with contains CLETRIS source files.

Package

cletris

Source

specials.lisp (file)

Special Variable: *scores*

The best scores.

Package

cletris

Source

specials.lisp (file)

Special Variable: *speed*
Package

cletris

Source

specials.lisp (file)

Special Variable: *version*
Package

cletris

Source

specials.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.3 Functions

Function: add-line MATRIX

Add a line which contains a few blocks to MATRIX.

Package

cletris

Source

cletris.lisp (file)

Function: clean-matrix MATRIX

Search filled lines into MATRIX and delete them. Return number of fulled lines deleted.

Package

cletris

Source

cletris.lisp (file)

Function: display-about ()

Show about informations if no games running.

Package

cletris

Source

cletris.lisp (file)

Function: display-scores ()

Show best scores.

Package

cletris

Source

cletris.lisp (file)

Function: draw-block BLOCK X Y

Print a block on (x,y) coordonates.

Package

cletris

Source

cletris.lisp (file)

Function: draw-game MATRIX BLOCK NEXT-BLOCK BLOCK-X BLOCK-Y LINES LEVEL POINTS &optional USERNAME

Draw the MATRIX game, old blocks, current BLOCK and the NEXT-BLOCK. LINES and LEVEL is for the user.

Package

cletris

Source

cletris.lisp (file)

Function: draw-square X Y R G B

Draw a square from (X,Y) with color defined by R G B codes.

Package

cletris

Source

cletris.lisp (file)

Function: finish-game LINES LEVEL POINTS

Finish the user’s game.

Package

cletris

Source

cletris.lisp (file)

Function: get-block RS

Get a new random colored block using the random state RS.

Package

cletris

Source

cletris.lisp (file)

Function: get-cletris-directory ()

Get the home directory of Cletris.

Package

cletris

Source

cletris.lisp (file)

Function: get-points NB

Return the number of points from number of deleted lines.

Package

cletris

Source

cletris.lisp (file)

Function: in-area-p MATRIX BLOCK BLOCK-X BLOCK-Y KEY

Check if the current BLOCK is in the area. KEY is :left or :right.

Package

cletris

Source

cletris.lisp (file)

Function: init-matrix ()

Creates a new matrix.

Package

cletris

Source

cletris.lisp (file)

Function: iso-time &optional TIME

Returns the universal time TIME as a string in full ISO format.

Package

cletris

Source

cletris.lisp (file)

Function: left-right-handler MATRIX BLOCK BLOCK-X BLOCK-Y KEY

Manage left or right BLOCK movement specified by KEY. Return the new BLOCK-X.

Package

cletris

Source

cletris.lisp (file)

Function: make-game ()

Creates a new Tetris game client.

Package

cletris

Source

cletris.lisp (file)

Function: random-elt RS SEQUENCE
Package

cletris

Source

cletris.lisp (file)

Function: read-scores ()

Load the best scores.

Package

cletris

Source

cletris.lisp (file)

Function: rotate MATRIX BLOCK BLOCK-X BLOCK-Y

Rotate the BLOCK if the new rotated block is in the game area.

Package

cletris

Source

cletris.lisp (file)

Function: show-matrix MATRIX &optional STREAM

Print to STREAM the MATRIX.

Package

cletris

Source

cletris.lisp (file)

Function: update-matrix MATRIX BLOCK BLOCK-X BLOCK-Y

Update the matrix saving the current block.

Package

cletris

Source

cletris.lisp (file)

Function: update-scores USERNAME POINTS

Update the score’s file. Add POINTS of USERNAME in the score list. Return a list of the 10 best scores.

Package

cletris

Source

cletris.lisp (file)

Function: write-scores SCORES

Write the best scores.

Package

cletris

Source

cletris.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.4 Generic functions

Generic Function: delete-line GAME NUMBER

Handler for when a a game-client delete a line.

Package

cletris

Source

cletris.lisp (file)

Methods
Method: delete-line (GAME game) NUMBER
Generic Function: draw TETRIS

Draw a Tetris game.

Package

cletris

Source

cletris.lisp (file)

Methods
Method: draw (S tetris)
Generic Function: game-block OBJECT
Generic Function: (setf game-block) NEW-VALUE OBJECT
Package

cletris

Methods
Method: game-block (GAME game)

automatically generated reader method

Source

cletris.lisp (file)

Method: (setf game-block) NEW-VALUE (GAME game)

automatically generated writer method

Source

cletris.lisp (file)

Generic Function: game-block-x OBJECT
Generic Function: (setf game-block-x) NEW-VALUE OBJECT
Package

cletris

Methods
Method: game-block-x (GAME game)

automatically generated reader method

Source

cletris.lisp (file)

Method: (setf game-block-x) NEW-VALUE (GAME game)

automatically generated writer method

Source

cletris.lisp (file)

Generic Function: game-block-y OBJECT
Generic Function: (setf game-block-y) NEW-VALUE OBJECT
Package

cletris

Methods
Method: game-block-y (GAME game)

automatically generated reader method

Source

cletris.lisp (file)

Method: (setf game-block-y) NEW-VALUE (GAME game)

automatically generated writer method

Source

cletris.lisp (file)

Generic Function: game-level OBJECT
Generic Function: (setf game-level) NEW-VALUE OBJECT
Package

cletris

Methods
Method: game-level (GAME game)

automatically generated reader method

Source

cletris.lisp (file)

Method: (setf game-level) NEW-VALUE (GAME game)

automatically generated writer method

Source

cletris.lisp (file)

Generic Function: game-lines OBJECT
Generic Function: (setf game-lines) NEW-VALUE OBJECT
Package

cletris

Methods
Method: game-lines (GAME game)

automatically generated reader method

Source

cletris.lisp (file)

Method: (setf game-lines) NEW-VALUE (GAME game)

automatically generated writer method

Source

cletris.lisp (file)

Generic Function: game-matrix OBJECT
Generic Function: (setf game-matrix) NEW-VALUE OBJECT
Package

cletris

Methods
Method: game-matrix (GAME game)

automatically generated reader method

Source

cletris.lisp (file)

Method: (setf game-matrix) NEW-VALUE (GAME game)

automatically generated writer method

Source

cletris.lisp (file)

Generic Function: game-next-block OBJECT
Generic Function: (setf game-next-block) NEW-VALUE OBJECT
Package

cletris

Methods
Method: game-next-block (GAME game)

automatically generated reader method

Source

cletris.lisp (file)

Method: (setf game-next-block) NEW-VALUE (GAME game)

automatically generated writer method

Source

cletris.lisp (file)

Generic Function: game-points OBJECT
Generic Function: (setf game-points) NEW-VALUE OBJECT
Package

cletris

Methods
Method: game-points (GAME game)

automatically generated reader method

Source

cletris.lisp (file)

Method: (setf game-points) NEW-VALUE (GAME game)

automatically generated writer method

Source

cletris.lisp (file)

Generic Function: tetris-image OBJECT
Generic Function: (setf tetris-image) NEW-VALUE OBJECT
Package

cletris

Methods
Method: tetris-image (TETRIS tetris)

automatically generated reader method

Source

cletris.lisp (file)

Method: (setf tetris-image) NEW-VALUE (TETRIS tetris)

automatically generated writer method

Source

cletris.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

6.2.5 Classes

Class: background ()
Package

cletris

Source

cletris.lisp (file)

Direct superclasses

tetris (class)

Direct Default Initargs
InitargValue
:image(pal:tag (quote cletris::background))
Class: game ()

A new Tetris game.

Package

cletris

Source

cletris.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: matrix
Initargs

:matrix

Readers

game-matrix (generic function)

Writers

(setf game-matrix) (generic function)

Slot: block
Initargs

:block

Readers

game-block (generic function)

Writers

(setf game-block) (generic function)

Slot: next-block
Initargs

:next-block

Readers

game-next-block (generic function)

Writers

(setf game-next-block) (generic function)

Slot: block-x
Initargs

:block-x

Readers

game-block-x (generic function)

Writers

(setf game-block-x) (generic function)

Slot: block-y
Initargs

:block-y

Readers

game-block-y (generic function)

Writers

(setf game-block-y) (generic function)

Slot: level
Initargs

:level

Initform

0

Readers

game-level (generic function)

Writers

(setf game-level) (generic function)

Slot: lines
Initargs

:lines

Initform

0

Readers

game-lines (generic function)

Writers

(setf game-lines) (generic function)

Slot: points
Initargs

:points

Initform

0

Readers

game-points (generic function)

Writers

(setf game-points) (generic function)

Class: tetris ()
Package

cletris

Source

cletris.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses

background (class)

Direct methods
Direct slots
Slot: image
Initargs

:image

Readers

tetris-image (generic function)

Writers

(setf tetris-image) (generic function)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L   M  
Index Entry  Section

C
cletris.asd: The cletris<dot>asd file
cletris/src: The cletris/src module
cletris/src/cletris.lisp: The cletris/src/cletris<dot>lisp file
cletris/src/package.lisp: The cletris/src/package<dot>lisp file
cletris/src/specials.lisp: The cletris/src/specials<dot>lisp file

F
File, Lisp, cletris.asd: The cletris<dot>asd file
File, Lisp, cletris/src/cletris.lisp: The cletris/src/cletris<dot>lisp file
File, Lisp, cletris/src/package.lisp: The cletris/src/package<dot>lisp file
File, Lisp, cletris/src/specials.lisp: The cletris/src/specials<dot>lisp file

L
Lisp File, cletris.asd: The cletris<dot>asd file
Lisp File, cletris/src/cletris.lisp: The cletris/src/cletris<dot>lisp file
Lisp File, cletris/src/package.lisp: The cletris/src/package<dot>lisp file
Lisp File, cletris/src/specials.lisp: The cletris/src/specials<dot>lisp file

M
Module, cletris/src: The cletris/src module

Jump to:   C   F   L   M  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   C   D   F   G   I   L   M   R   S   T   U   W  
Index Entry  Section

(
(setf game-block): Internal generic functions
(setf game-block): Internal generic functions
(setf game-block-x): Internal generic functions
(setf game-block-x): Internal generic functions
(setf game-block-y): Internal generic functions
(setf game-block-y): Internal generic functions
(setf game-level): Internal generic functions
(setf game-level): Internal generic functions
(setf game-lines): Internal generic functions
(setf game-lines): Internal generic functions
(setf game-matrix): Internal generic functions
(setf game-matrix): Internal generic functions
(setf game-next-block): Internal generic functions
(setf game-next-block): Internal generic functions
(setf game-points): Internal generic functions
(setf game-points): Internal generic functions
(setf tetris-image): Internal generic functions
(setf tetris-image): Internal generic functions

A
add-line: Internal functions

C
clean-matrix: Internal functions
cletris: Exported functions

D
delete-line: Internal generic functions
delete-line: Internal generic functions
display-about: Internal functions
display-scores: Internal functions
draw: Internal generic functions
draw: Internal generic functions
draw-block: Internal functions
draw-game: Internal functions
draw-square: Internal functions

F
finish-game: Internal functions
Function, add-line: Internal functions
Function, clean-matrix: Internal functions
Function, cletris: Exported functions
Function, display-about: Internal functions
Function, display-scores: Internal functions
Function, draw-block: Internal functions
Function, draw-game: Internal functions
Function, draw-square: Internal functions
Function, finish-game: Internal functions
Function, get-block: Internal functions
Function, get-cletris-directory: Internal functions
Function, get-points: Internal functions
Function, in-area-p: Internal functions
Function, init-matrix: Internal functions
Function, iso-time: Internal functions
Function, left-right-handler: Internal functions
Function, make-game: Internal functions
Function, random-elt: Internal functions
Function, read-scores: Internal functions
Function, rotate: Internal functions
Function, show-matrix: Internal functions
Function, update-matrix: Internal functions
Function, update-scores: Internal functions
Function, write-scores: Internal functions

G
game-block: Internal generic functions
game-block: Internal generic functions
game-block-x: Internal generic functions
game-block-x: Internal generic functions
game-block-y: Internal generic functions
game-block-y: Internal generic functions
game-level: Internal generic functions
game-level: Internal generic functions
game-lines: Internal generic functions
game-lines: Internal generic functions
game-matrix: Internal generic functions
game-matrix: Internal generic functions
game-next-block: Internal generic functions
game-next-block: Internal generic functions
game-points: Internal generic functions
game-points: Internal generic functions
Generic Function, (setf game-block): Internal generic functions
Generic Function, (setf game-block-x): Internal generic functions
Generic Function, (setf game-block-y): Internal generic functions
Generic Function, (setf game-level): Internal generic functions
Generic Function, (setf game-lines): Internal generic functions
Generic Function, (setf game-matrix): Internal generic functions
Generic Function, (setf game-next-block): Internal generic functions
Generic Function, (setf game-points): Internal generic functions
Generic Function, (setf tetris-image): Internal generic functions
Generic Function, delete-line: Internal generic functions
Generic Function, draw: Internal generic functions
Generic Function, game-block: Internal generic functions
Generic Function, game-block-x: Internal generic functions
Generic Function, game-block-y: Internal generic functions
Generic Function, game-level: Internal generic functions
Generic Function, game-lines: Internal generic functions
Generic Function, game-matrix: Internal generic functions
Generic Function, game-next-block: Internal generic functions
Generic Function, game-points: Internal generic functions
Generic Function, tetris-image: Internal generic functions
get-block: Internal functions
get-cletris-directory: Internal functions
get-points: Internal functions

I
in-area-p: Internal functions
init-matrix: Internal functions
iso-time: Internal functions

L
left-right-handler: Internal functions

M
make-game: Internal functions
Method, (setf game-block): Internal generic functions
Method, (setf game-block-x): Internal generic functions
Method, (setf game-block-y): Internal generic functions
Method, (setf game-level): Internal generic functions
Method, (setf game-lines): Internal generic functions
Method, (setf game-matrix): Internal generic functions
Method, (setf game-next-block): Internal generic functions
Method, (setf game-points): Internal generic functions
Method, (setf tetris-image): Internal generic functions
Method, delete-line: Internal generic functions
Method, draw: Internal generic functions
Method, game-block: Internal generic functions
Method, game-block-x: Internal generic functions
Method, game-block-y: Internal generic functions
Method, game-level: Internal generic functions
Method, game-lines: Internal generic functions
Method, game-matrix: Internal generic functions
Method, game-next-block: Internal generic functions
Method, game-points: Internal generic functions
Method, tetris-image: Internal generic functions

R
random-elt: Internal functions
read-scores: Internal functions
rotate: Internal functions

S
show-matrix: Internal functions

T
tetris-image: Internal generic functions
tetris-image: Internal generic functions

U
update-matrix: Internal functions
update-scores: Internal functions

W
write-scores: Internal functions

Jump to:   (  
A   C   D   F   G   I   L   M   R   S   T   U   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *   +  
B   C   I   L   M   N   P   S  
Index Entry  Section

*
*cletris-directory*: Internal special variables
*debug*: Exported special variables
*scores*: Internal special variables
*speed*: Internal special variables
*version*: Internal special variables

+
+background+: Internal constants
+blocks+: Internal constants
+game-left-corner-x+: Internal constants
+game-left-corner-y+: Internal constants
+height+: Internal constants
+matrix-background+: Internal constants
+width+: Internal constants

B
block: Internal classes
block-x: Internal classes
block-y: Internal classes

C
Constant, +background+: Internal constants
Constant, +blocks+: Internal constants
Constant, +game-left-corner-x+: Internal constants
Constant, +game-left-corner-y+: Internal constants
Constant, +height+: Internal constants
Constant, +matrix-background+: Internal constants
Constant, +width+: Internal constants

I
image: Internal classes

L
level: Internal classes
lines: Internal classes

M
matrix: Internal classes

N
next-block: Internal classes

P
points: Internal classes

S
Slot, block: Internal classes
Slot, block-x: Internal classes
Slot, block-y: Internal classes
Slot, image: Internal classes
Slot, level: Internal classes
Slot, lines: Internal classes
Slot, matrix: Internal classes
Slot, next-block: Internal classes
Slot, points: Internal classes
Special Variable, *cletris-directory*: Internal special variables
Special Variable, *debug*: Exported special variables
Special Variable, *scores*: Internal special variables
Special Variable, *speed*: Internal special variables
Special Variable, *version*: Internal special variables

Jump to:   *   +  
B   C   I   L   M   N   P   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   B   C   G   P   S   T  
Index Entry  Section

B
background: Internal classes

C
Class, background: Internal classes
Class, game: Internal classes
Class, tetris: Internal classes
cletris: The cletris system
cletris: The cletris package

G
game: Internal classes

P
Package, cletris: The cletris package

S
System, cletris: The cletris system

T
tetris: Internal classes

Jump to:   B   C   G   P   S   T