Thursday, October 19, 2006

Module main entry points

Modules can now define an entry point. Here is the updated contrib/tetris/load.factor:
! Copyright (C) 2006 Alex Chapman
! See for BSD license.

REQUIRES: contrib/lazy-lists ;

PROVIDE: contrib/tetris {
"tetris-colours.factor" "tetromino.factor" "tetris-piece.factor"
"tetris-board.factor" "tetris.factor" "tetris-gl.factor"
} {
"test/tetris-piece.factor" "test/tetris-board.factor" "test/tetris.factor"
} ;

USE: tetris-gadget

MAIN: contrib/tetris tetris-window ;

This means with the latest darcs code (not 0.85) you can now run Tetris simply by starting Factor and entering the following:
"contrib/tetris" run-module
The module is loaded first (unless it has already been loaded).

No comments: