The cletris Reference Manual

This is the cletris Reference Manual, version 0.9.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:38:23 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cletris

A tetris game.

Maintainer

Nicolas Lamirault <>

Author

Nicolas Lamirault <>

License

MIT License

Version

0.9.0

Dependencies
  • pal (system).
  • cl-ppcre (system).
Source

cletris.asd.

Child Component

src (module).


3 Modules

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


3.1 cletris/src

Source

cletris.asd.

Parent Component

cletris (system).

Child Components

4 Files

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


4.1 Lisp


4.1.1 cletris/cletris.asd

Source

cletris.asd.

Parent Component

cletris (system).

ASDF Systems

cletris.


4.1.2 cletris/src/package.lisp

Source

cletris.asd.

Parent Component

src (module).

Packages

cletris.


4.1.3 cletris/src/specials.lisp

Dependency

package.lisp (file).

Source

cletris.asd.

Parent Component

src (module).

Public Interface

*debug* (special variable).

Internals

4.1.4 cletris/src/cletris.lisp

Dependency

specials.lisp (file).

Source

cletris.asd.

Parent Component

src (module).

Public Interface

cletris (function).

Internals

5 Packages

Packages are listed by definition order.


5.1 cletris

A Tetris game.

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

6 Definitions

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


6.1 Public Interface


6.1.1 Special variables

Special Variable: *debug*

When T, active some logs for debugging.

Package

cletris.

Source

specials.lisp.


6.1.2 Ordinary 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.


6.2 Internals


6.2.1 Constants

Constant: +background+
Package

cletris.

Source

specials.lisp.

Constant: +blocks+
Package

cletris.

Source

specials.lisp.

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

cletris.

Source

specials.lisp.

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

cletris.

Source

specials.lisp.

Constant: +height+

The default height.

Package

cletris.

Source

specials.lisp.

Constant: +matrix-background+
Package

cletris.

Source

specials.lisp.

Constant: +width+

The default width.

Package

cletris.

Source

specials.lisp.


6.2.2 Special variables

Special Variable: *cletris-directory*

Directory with contains CLETRIS source files.

Package

cletris.

Source

specials.lisp.

Special Variable: *scores*

The best scores.

Package

cletris.

Source

specials.lisp.

Special Variable: *speed*
Package

cletris.

Source

specials.lisp.

Special Variable: *version*
Package

cletris.

Source

specials.lisp.


6.2.3 Ordinary functions

Function: add-line (matrix)

Add a line which contains a few blocks to MATRIX.

Package

cletris.

Source

cletris.lisp.

Function: clean-matrix (matrix)

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

Package

cletris.

Source

cletris.lisp.

Function: display-about ()

Show about informations if no games running.

Package

cletris.

Source

cletris.lisp.

Function: display-scores ()

Show best scores.

Package

cletris.

Source

cletris.lisp.

Function: draw-block (block x y)

Print a block on (x,y) coordonates.

Package

cletris.

Source

cletris.lisp.

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.

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.

Function: finish-game (lines level points)

Finish the user’s game.

Package

cletris.

Source

cletris.lisp.

Function: get-block (rs)

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

Package

cletris.

Source

cletris.lisp.

Function: get-cletris-directory ()

Get the home directory of Cletris.

Package

cletris.

Source

cletris.lisp.

Function: get-points (nb)

Return the number of points from number of deleted lines.

Package

cletris.

Source

cletris.lisp.

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.

Function: init-matrix ()

Creates a new matrix.

Package

cletris.

Source

cletris.lisp.

Function: iso-time (&optional time)

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

Package

cletris.

Source

cletris.lisp.

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.

Function: make-game ()

Creates a new Tetris game client.

Package

cletris.

Source

cletris.lisp.

Function: random-elt (rs sequence)
Package

cletris.

Source

cletris.lisp.

Function: read-scores ()

Load the best scores.

Package

cletris.

Source

cletris.lisp.

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.

Function: show-matrix (matrix &optional stream)

Print to STREAM the MATRIX.

Package

cletris.

Source

cletris.lisp.

Function: update-matrix (matrix block block-x block-y)

Update the matrix saving the current block.

Package

cletris.

Source

cletris.lisp.

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.

Function: write-scores (scores)

Write the best scores.

Package

cletris.

Source

cletris.lisp.


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.

Methods
Method: delete-line ((game game) number)
Generic Function: draw (tetris)

Draw a Tetris game.

Package

cletris.

Source

cletris.lisp.

Methods
Method: draw ((s tetris))
Generic Reader: game-block (object)
Package

cletris.

Methods
Reader Method: game-block ((game game))

automatically generated reader method

Source

cletris.lisp.

Target Slot

block.

Generic Writer: (setf game-block) (object)
Package

cletris.

Methods
Writer Method: (setf game-block) ((game game))

automatically generated writer method

Source

cletris.lisp.

Target Slot

block.

Generic Reader: game-block-x (object)
Package

cletris.

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

automatically generated reader method

Source

cletris.lisp.

Target Slot

block-x.

Generic Writer: (setf game-block-x) (object)
Package

cletris.

Methods
Writer Method: (setf game-block-x) ((game game))

automatically generated writer method

Source

cletris.lisp.

Target Slot

block-x.

Generic Reader: game-block-y (object)
Package

cletris.

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

automatically generated reader method

Source

cletris.lisp.

Target Slot

block-y.

Generic Writer: (setf game-block-y) (object)
Package

cletris.

Methods
Writer Method: (setf game-block-y) ((game game))

automatically generated writer method

Source

cletris.lisp.

Target Slot

block-y.

Generic Reader: game-level (object)
Package

cletris.

Methods
Reader Method: game-level ((game game))

automatically generated reader method

Source

cletris.lisp.

Target Slot

level.

Generic Writer: (setf game-level) (object)
Package

cletris.

Methods
Writer Method: (setf game-level) ((game game))

automatically generated writer method

Source

cletris.lisp.

Target Slot

level.

Generic Reader: game-lines (object)
Package

cletris.

Methods
Reader Method: game-lines ((game game))

automatically generated reader method

Source

cletris.lisp.

Target Slot

lines.

Generic Writer: (setf game-lines) (object)
Package

cletris.

Methods
Writer Method: (setf game-lines) ((game game))

automatically generated writer method

Source

cletris.lisp.

Target Slot

lines.

Generic Reader: game-matrix (object)
Package

cletris.

Methods
Reader Method: game-matrix ((game game))

automatically generated reader method

Source

cletris.lisp.

Target Slot

matrix.

Generic Writer: (setf game-matrix) (object)
Package

cletris.

Methods
Writer Method: (setf game-matrix) ((game game))

automatically generated writer method

Source

cletris.lisp.

Target Slot

matrix.

Generic Reader: game-next-block (object)
Package

cletris.

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

automatically generated reader method

Source

cletris.lisp.

Target Slot

next-block.

Generic Writer: (setf game-next-block) (object)
Package

cletris.

Methods
Writer Method: (setf game-next-block) ((game game))

automatically generated writer method

Source

cletris.lisp.

Target Slot

next-block.

Generic Reader: game-points (object)
Package

cletris.

Methods
Reader Method: game-points ((game game))

automatically generated reader method

Source

cletris.lisp.

Target Slot

points.

Generic Writer: (setf game-points) (object)
Package

cletris.

Methods
Writer Method: (setf game-points) ((game game))

automatically generated writer method

Source

cletris.lisp.

Target Slot

points.

Generic Reader: tetris-image (object)
Package

cletris.

Methods
Reader Method: tetris-image ((tetris tetris))

automatically generated reader method

Source

cletris.lisp.

Target Slot

image.

Generic Writer: (setf tetris-image) (object)
Package

cletris.

Methods
Writer Method: (setf tetris-image) ((tetris tetris))

automatically generated writer method

Source

cletris.lisp.

Target Slot

image.


6.2.5 Classes

Class: background
Package

cletris.

Source

cletris.lisp.

Direct superclasses

tetris.

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

A new Tetris game.

Package

cletris.

Source

cletris.lisp.

Direct methods
Direct slots
Slot: matrix
Initargs

:matrix

Readers

game-matrix.

Writers

(setf game-matrix).

Slot: block
Package

common-lisp.

Initargs

:block

Readers

game-block.

Writers

(setf game-block).

Slot: next-block
Initargs

:next-block

Readers

game-next-block.

Writers

(setf game-next-block).

Slot: block-x
Initargs

:block-x

Readers

game-block-x.

Writers

(setf game-block-x).

Slot: block-y
Initargs

:block-y

Readers

game-block-y.

Writers

(setf game-block-y).

Slot: level
Initform

0

Initargs

:level

Readers

game-level.

Writers

(setf game-level).

Slot: lines
Initform

0

Initargs

:lines

Readers

game-lines.

Writers

(setf game-lines).

Slot: points
Initform

0

Initargs

:points

Readers

game-points.

Writers

(setf game-points).

Class: tetris
Package

cletris.

Source

cletris.lisp.

Direct subclasses

background.

Direct methods
Direct slots
Slot: image
Initargs

:image

Readers

tetris-image.

Writers

(setf tetris-image).


Appendix A Indexes


A.1 Concepts


A.2 Functions

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

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

A
add-line: Private ordinary functions

C
clean-matrix: Private ordinary functions
cletris: Public ordinary functions

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

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

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

I
in-area-p: Private ordinary functions
init-matrix: Private ordinary functions
iso-time: Private ordinary functions

L
left-right-handler: Private ordinary functions

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

R
random-elt: Private ordinary functions
read-scores: Private ordinary functions
rotate: Private ordinary functions

S
show-matrix: Private ordinary functions

T
tetris-image: Private generic functions
tetris-image: Private generic functions

U
update-matrix: Private ordinary functions
update-scores: Private ordinary functions

W
write-scores: Private ordinary functions


A.3 Variables

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

*
*cletris-directory*: Private special variables
*debug*: Public special variables
*scores*: Private special variables
*speed*: Private special variables
*version*: Private special variables

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

B
block: Private classes
block-x: Private classes
block-y: Private classes

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

I
image: Private classes

L
level: Private classes
lines: Private classes

M
matrix: Private classes

N
next-block: Private classes

P
points: Private classes

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