tdammers / tiny-games-hs

Rules for & examples of tiny haskell games

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Rules

Here are the general rules for this round:

  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 are permitted after line 11. The game's "category/name (author)" info should appear here, and any essential info like player controls, so the game is usable to someone seeing just this file, eg in chat.

  4. Achieving programs that "just work" is a core principle and part of the challenge. The script or program must either

    • be reliably runnable via shebang line (shebang lines are counted as code, but will impress the judges)
    • or contain a reliable build/run command line with all needed options, in the comments (the play script will use this).

    Entries which aren't straightforward to run and enjoy are incomplete. Some tips:

    • 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).
    • env -S in the shebang line doesn't work on older GNU/Linux systems, but we allow it (see haskell-game#25).
    • stack scripts can seem to hang at first startup while downloading snapshot info. For prelude/base/default categories, using --resolver=ghc-9.2.5 avoids this (see haskell-game#38).
    • stack scripts can use --verbosity=error to silence the "Selected resolver" output.
    • If using packages which require compilation (gloss), use stack script --compile. (And be aware a newer compiled binary can cause your source to be ignored.)
    • cabal scripts are also welcome; they don't have --compile and require more lines (unless you use env -S)
    • On mac, Terminal and iTerm 3.4 render emojis slowly; iTerm 3.5 beta works better.
  5. The game should be portable, running on all major platforms, ideally.

  6. A small square screenshot must be provided, 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.)

  7. A README file is optional but makes browsing your game more pleasant for website visitors. Feel free to include animations, or discussion of the game/code/your experience.

  8. A less-minified version of the code, that we can learn from, is optional but welcome.

  9. Contest entries will be collected in the official repo (haskell-game/tiny-games-hs). You can update your entries freely until the contest end, 2023-02-28 11:59:59 UTC, at which time they are frozen for posterity and judging (no exceptions). If you need to share post-contest improvements, you are welcome to publish as new files in the same directory.

  10. 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)

Games

Here are the entries received so far!

prelude-10-80


guess1

(sm)

pure-doors

(tristanC)

fifteen

(bradrn)

chess

(fizruk)

sudoku

(elderephemera)

matchmaking
(migmit)

tiny-brot
(tristanC)

mini-othello
(hellwolf)

one-dot

(OsePedro)

expressit

(Greg8128)

base-10-80


timing

(TravisCardwell)

shoot

(migmit)

log2048

(Lysxia)

rhythm

(elderephemera)

peyton-says

(gergoerdi)

default-10-80


type-and-furious

(lsmor)

shmupemup

(elderephemera)

tsp
(tristanC)

hackage-10-80


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)

brickbreaker

(fgaz)

lazy-march
(tristanc)

balances

(sm)

vaders

(gergoerdi)

tetris

(gergoerdi)

Let's play!

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:

or:

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.

Development Tools

Minifier

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.

About

Rules for & examples of tiny haskell games


Languages

Language:Haskell 94.6%Language:Shell 5.3%Language:Makefile 0.1%