/tiny-games-hs

Rules for & examples of tiny haskell games

Primary LanguageHaskell

Haskell Tiny Game Jam

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 February:

  1. Make a playable game in one haskell file of up to 10 lines of up to 80 characters each.
  2. 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.
  3. Unlimited comments and notes are permitted after line 11. The game's "category/name (author)" info should appear here.
  4. 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.
  5. The game must be accompanied by a small square static screenshot for the main README. (Animated gifs get obscured by Github's player overlay - but are great at larger size in your game's readme.)
  6. The game should run on all major platforms, ideally.
  7. Contest entries will be collected in this repo.

Compete in any or all of these categories:

prelude (gam-10-80-hs-prelude)

  • Only the standard prelude may be used (no imports). (template1)

guess1

(sm)

pure-doors

(tristanC)

base (gam-10-80-hs-base)

  • Imports from the base package may be used. (template1)

timing

(TravisCardwell)

shoot

(migmit)

log2048

(Lysxia)

default (gam-10-80-hs-default)

  • All packages installed by default with the tested ghc version may be used. (template1)
  • A second file named Import.hs may be used, to gather imports and re-exports (only).

hackage (gam-10-80-hs-hackage)

  • As above, but all packages released on Hackage may be used. (template1)

guess2

(sm)

wordle

(halogenandtoast)

ski

(sm)

guesscolor

(TravisCardwell)

bulls-n-cows

(akadude)

hallway-to-hell
(juliendehos)

1234-hero
(gelisam)

Let's play!

You will need a suitable version of GHC (8.10.7+, 9.2.5+, or 9.4.4+ are good bets), 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).
Most games will return here on exit (others will require CTRL-c).

 1) prelude/pure-doors.hs
 2) base/shoot/shoot.hs
 3) base/timing/timing.hs
 4) prelude/guess1.hs
 5) hackage/guess2.hs
 6) hackage/1234-hero/1234-hero.hs
 7) hackage/ski/ski.hs
 8) hackage/bulls-n-cows.hs
 9) hackage/wordle.hs
10) hackage/guesscolor/guesscolor.hs
11) hackage/hallway-to-hell/hallway-to-hell.hs
12) base/log2048/log2048.hs
13) Quit
** Enter a number to play or quit, or press enter to see the list again: 

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.