Inspired by the BASIC 10Liner contest (see their english rules at the bottom): the first Haskell tiny games contest runs through February 2023! The prize.. glory!
Submit your entries now (as many as you like) to this repo (send a pull request, or push if you have access), or paste in the #haskell-game chat (Matrix or IRC) and we'll commit for you. sm and f-a are your judges, informed by #haskell-game.
Here are the general rules for this round:
- Make a playable game in one haskell file of up to 10 lines of up to 80 characters each.
- This can be a runghc, stack or cabal script, or a small haskell program, but not a multi-file project. Some templates are provided to give ideas. Our ideal is a self-contained 10 line program that just works, like BASIC programs.
- Unlimited comments and notes are permitted after line 11. The game's "category/name (author)" info should appear here, and brief essential info like player controls (in case someone sees just this file, eg in chat).
- The script or program must either be executable and run reliably (eg like a stack script),
or it must contain reliable build instructions (eg a ghc command line with all needed package options).
Entries which aren't straightforward to run are incomplete.
Achieving programs that "just work" is a core principle and part of the challenge.
Tips:
- env -S in the shebang line doesn't work on older GNU/Linux systems. If you use it, also show a reliable run command in the comments, to be used in in the play script. (See haskell-game#25.)
- Avoid requiring problematic GHC versions. In particular GHC <9.2 doesn't work well on mac. If you specify a GHC version/stackage snapshot, the current release is ideal (GHC 9.2, lts-20).
- The game should run on all major platforms, ideally.
- The game must be accompanied by a small square screenshot, ideally static and non-gif. (Not animated, because Github's player overlay will obscure it. Not a gif, because you can't make those clickable on Github it seems.)
- A separate README file is optional, but can add value, such as animations, or discussion of the game/code/experience. Website visitors will see this on clicking your game.
- You're welcome to include a less-minified version of the code, that people can learn from.
- Contest entries will be collected in this repo.
- You can submit any number of entries, in the following categories:
prelude-10-80
: No imports may be used. (template1)
base-10-80
: Imports from the base package may be used. (template1)
default-10-80
: Packages installed by default with GHC may be used.
Also a second file named Import.hs may be used to gather and re-export imports, only.
(template1)
hackage-10-80
: All packages on Hackage may be used, and an Import.hs file may be used. (template1)
Here are the entries received so far:
guess1 (sm) |
pure-doors (tristanC) |
fifteen (bradrn) |
chess (fizruk) |
sudoku (elderephemera) |
matchmaking (migmit) |
timing (TravisCardwell) |
shoot (migmit) |
log2048 (Lysxia) |
rhythm (elderephemera) |
None.
guess2 (sm) |
wordle (halogenandtoast) |
ski (sm) |
guesscolor (TravisCardwell) |
bulls-n-cows (akadude) |
hallway-to-hell (juliendehos) |
1234-hero (gelisam) |
crappy-flappy (gergoerdi) |
pong (gergoerdi) |
minesweeper (Greg8128) |
pong2 (sm) |
You will need a suitable version of GHC (9.2.5+ or 9.4.4+ recommended), and stack (or cabal).
See https://www.haskell.org/get-started/.
Once Haskell is installed, and if you have bash, you can run ./play
in this repo:
~/src/tiny-games-hs$ ./play
--------------------------------------------------------
___ __
|__| _ _| _|| | . _ / _ _ _ _ | _ _ /|
| |(_|_)|((-|| | || )\/ \__)(_||||(- __)(_|||| |
--------------------------------------------------------
Here are the entries from HTGJ1, Feb 2023 !
This script can run each game for you, using ghc or stack
(if you don't have these yet, see https://www.haskell.org/get-started).
Usage: play [NUM|NAME|SUBSTR]
1) guess1 [prelude]
2) pure-doors [prelude]
3) fifteen [prelude]
4) chess [prelude]
...
or:
$ alias p=~/src/tiny-games-hs/play
$ p chess
$ p 4
If you don't have bash, cd into each game's directory and try running the game's .hs file. If that fails, look for run/build instructions in that file or a nearby readme.
Since haskell-game#14, we have a minifier that can turn your game into a brick of inscrutable code no more than 80 characters wide, provided that you add curled braces and semicolons over all your program, so that it becomes white space insensitive. @kindaro is the owner of the minifier, ping him with your reviews and suggestions.