Giter Site home page Giter Site logo

tiny-games-hs's Introduction

Haskell Tiny Game Jam

The first Haskell tiny games contest took place in February 2023, inspired by the BASIC 10Liner contest (see also their 2023 entries). f-a linked that in the #haskell-game chat, sm organised the contest, and Haskell game devs showed up in force. Our mission was to make playable games in 10 lines of 80 characters of Haskell. The prize.. Glory! Also fun, learning, and advancing Haskell's suitability for game dev and programming in the small. The contest ran from 2023-02-07 to 2023-02-28 and the results were announced on 2023-03-10.

Games

Here are all the entries, by category and submission order, with links to their reviews, readmes, and source.

prelude-10-80

In this category, no imports were allowed.


guess1

(sm)

pure-doors

(tristanC)

fifteen

(bradrn)

chess

(fizruk)

sudoku

(elderephemera)

matchmaking
(migmit)

tiny-brot
(tristanC)

mini-othello
(hellwolf)

one-dot

(OsePedro)

expressit

(Greg8128)

life

(Rens van Hienen)

call-by-push-block
(cole-k)

companion

(Greg8128)

hangman

(kukimik)

quine

(tristanC)

base-10-80

In this category, imports from the base package were allowed.


timing

(TravisCardwell)

shoot

(migmit)

log2048

(Lysxia)

rhythm

(elderephemera)

peyton-says

(gergoerdi)

acey-deucey

(trevarj)

flower-seeds

(tristanC)

lambda-ray
(tristanC)

7up7down

(akshaymankar)

snake

(akshaymankar)
woosh.caves
(Kindaro)
woosh.forest
(Kindaro)

default-10-80

In this category, imports from GHC's default packages were allowed, plus an optional Import.hs file for import declarations.


type-and-furious

(lsmor)

shmupemup

(elderephemera)

tsp
(tristanC)

lol
(hellwolf)

space-invaders

(meooow25)
swish.easy
(Kindaro)
swish.survival
(Kindaro)

lc

(byorgey)

hackage-10-80

In this category, imports from all of Hackage were allowed, plus an optional Import.hs file for import declarations.


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)

short-guess

(RimuhRimu)

hexescape

(nevrome)

snake-lemma

(gergoerdi)

subpar-hexagon

(gergoerdi)

Reviews

We are very pleased to announce.. the results of Haskell Tiny Game Jam 2023 ! Congratulations and thanks to all participants!

  • 55 entries in 4 categories from 28 entrants in 3 weeks
  • 109 reviews, 5 winners and 6 honourable mentions from 2 judges
  • Shell script to browse and play the games on all major platforms (single binary coming later maybe)
  • Readable source versions, useful development tips, informative blog posts

This was the first Haskell game dev contest. We invite you to come and play, read, and get inspired for the next one!

Creating a 10-line tiny game in Haskell and shipping a contest entry is a non-trivial task. If you succeeded, double congratulations! You are one of very few people in the world who could complete this task in the next few hours.

The judges were sm and f-a. Below you will find our reviews, by category and submission order, followed by the contest winners. Our ratings aimed to reflect playable and fun Haskell tiny games satisfying the contest rules. With single ratings and human biases, judging will of course be imperfect. We invite the players to try all games, as the selection is impressive.

sm: I highly value games that caused me to experience Fun. Good feel, gameplay, challenge, replayability, etc. all help. I have a fondness for real-time action/arcade games, which in my early programming days were always the most rare, desirable, exciting and difficult to achieve. I value games that are easy to get started with. So, if documentation must be used, I appreciate it being there and being clear. I highly value games that are straightforward to install and that just work. This was mostly ensured before the deadline, so wasn't often factor in the judging. I value the creativity, innovation and extreme cleverness required to deliver these things in a tiny package!

f-a: The trifecta of game-making is: running without fuss; clear controls; fun to play! In a ten-liner, cornes have to be cut and decision have to be made, so I try to understand what the developers had in mind and how they balanced those factors. Innovation, immersion and efficient usage of scarce means are welcome.

ratings.tsv has a summary of the ratings, or run ./getratings to see another view.

Prelude

guess1 (sm)

f-a: what can I say, it is a short game… Probably the shortest of the competition. Also could be sold for hundreds of euros as a postmodernist installation. Rating: N/A, judge made.

sm: The most minimal "game" I could think of, just a demo/template while setting up the contest. Also the most unbeatable game in the collection; the only winning move is not to play. Rating: my entry

pure-doors (tristanC)

f-a: A vertical type of Angry Birds game. I actually enjoyed this a lot; a fun way to play this is to start a metronome (or your favourite song) and “play to the beat”, i.e. force yourself to press one key per beat (or measure, if the song is fast). Cute, ASCII, contained in nine lines, thumbs up for me. Rating: 6/10

sm: A turn-based piloting game (I think of it as a minimal Zaxxon). use JKL and ENTER to steer your ship through narrow gaps in a series of walls. Nicely documented, read the docs for best scoring. See also the dev write-up at https://tristancacqueray.github.io/blog/tiny-game-engine. Rating: 6/10

fifteen (bradrn)

f-a: Excellent user experience on this one: controls explained in-game, a clean & cosy interface, lisergic amount of ‘:’ in the code. Fifteen is always a nice puzzle and this implementation does it justice. Rating: 7/10

sm: The sliding fifteen tiles puzzle. The tiles start out mostly ordered, which threw me off - I expected to see a randomised layout. But in fact the last row is misordered. I'm not sure how difficult this is to solve.. more than enough for me. Seems to work by a ton of clever pattern matching. Rating: 7/10

chess (fizruk)

f-a: Not a game but a chessboard implementation. Rules are not there — obviously you cannot expect “en passant” in a ten-liner — so you can more your e pawn to the eight rank on the first move! (Sadly, it cannot be promoted.) Eleven-liner, not a tenner. Rating: 5/10

sm: Not a single-player game, but a working chess board for two human players. Uses unicode chess glyphs. Not documented except in the PR, but fairly self explanatory. Rating: 7/10

sudoku (elderephemera) 🔷

f-a: Tremendous effort to have a sudoku implementation in 796 characters. This has: a generator (which takes some seconds to some minutes, be patient), a game-mode and a solver too, quite remarkable! Interface is clean (it warns you of mistakes and you can even type ’.’ to erase a cell — what more do you want?), README informative. Rating: 8/10

sm: A sudoku puzzle generator and solver. Nicely documented, although without a readable source version. Seed 0 produces a nice easy puzzle - if you can fill in all spaces without any turning red, you have solved it. Seed 2 makes it churn for a long time - impressive number crunching from such a tiny game - does that mean a more difficult puzzle ? Very cool and useful for sudoku fans. Possibly unique among these games in producing entertainment you can share to anyone including non-computer users. Rating: 9/10

matchmaking (migmit) 🔷

f-a: One of the best stories of the competition, which puts you in the role of a matchmaker in a Hungarian village. Pairing boys and girls is no small feat, carelessness will lead to a subpar number of marriages! I enjoyed playing this: novel ideal, excellent theme description, good documentation and interface. Primo! Rating: 9/10

sm: A simple puzzle game with a nice back story. Good player docs; no dev notes or readable source version. Uses runghc's -cpp option to cram more code into the shebang line. Rating: 6/10

tiny-brot (tristanC)

f-a: A seven-liner demo showcasing a fractal. Not a game, but a good showcase of coding skills. Don’t forget to press to zoom in! Rating: 6/10

sm: Not a game, but a nifty mandelbrot fractal visualiser. Each press of ENTER zooms in to show more detail (I think). One of the tiniest entries, using only six lines of Haskell code. See also the dev write-up at https://tristancacqueray.github.io/blog/tiny-game-engine. Rating: 7/10

mini-othello (hellwolf)

f-a: This is a remarkable implementation of the classic Othello in just ten lines of Haskell code. The AI, despite being rudimental, managed to beat me multiple times. Interface is a bit rough — expected in a ten-liner — but the README makes up for it. Very good gaming experience. Rating: 7/10

sm: An othello game with a reasonable computer opponent ? In ten lines ? Outstanding! I seemed to see a bug during play when it failed to flip some of my pieces, but it has not been reproduced. More testers needed, or just User error ? No readme included but there is some good documentation in the source, visible with ./play mini-othello -h, and fine dev notes published at http://miaozc.me/2023-02-27-hs-tiny-games.html. Rating: 8/10

one-dot (OsePedro)

f-a: Very good puzzle game: ASCII representation is clean and uncluttered (other games print a new board on each move, this one takes the better approach with a persistent representation), game rules (from the good README) easy to get. Game is devilishly difficult though! I suggest everyone to start with a smaller board size. Rating: 8/10

sm: A challenging puzzle game. Restore a randomised board to order by flipping 3x3 sections. Good docs, no readable source version but does come with a description of each function. Rating: 7/10

expressit (Greg8128) 🔷

f-a: A game that does away from 2D ASCII trickes, refreshing. The goal is to form valid expressions (in RPN) to reach some kind of numeric goal. This takes some time to get used — and a few stack empty errors —; I enjoyed it immensely, it is quite a challenge to compute RPN in your head, even something simple as reach 5 from n=7. Be sure to check the README before trying to crack more difficult problems: operands are wild (c: collatz function). Great idea! Rating: 9/10

sm: A mathematical puzzler. You must create expressions for a stack-based calculator in order to transform a value to a given target value. Puzzles increase in difficulty. No dev notes; fairly good player docs, but I still had trouble figuring out acceptable entries. Eg, for n=1, target=1, n1* is rejected, but n works. For n=1, target=2, n2* is rejected, but nn+ works. Rating: 6/10

life (Rens van Hienen)

f-a: Implementation of Conway’s game of life. On-screen command hints are always appreciated by reviewers. Cosy to see your little civilisation growing up. Rating: 7/10

sm: The Game of Life, a "zero player game" and the most famous cellular automaton, where cells live or die based on how many live neighbours they have. The playing field is blank by default; you should enter t X Y to enliven some cells, then repeatedly type n ENTER to step the simulation. Perhaps a non-stop mode is possible in version 2 ? Provides on-screen help, unlike many tiny games. Comes with dev notes in the source file. Rating: 6/10

call-by-push-block (cole-k) 🏆🏅

f-a: What can I say, a beautiful game which is among the most polished entries in the competition, from interface to actual gameplay, to some unholy tricks in the code bending the rules of the competition. The comfy factor is amazing: you are introduced to the puzzle bit by bit, in an effortless manner, discovering clever mechanics along the way, with a twist on level five that left me speechless (“How could he manage to fit that in 10 lin- ohhhh”). Rating: 10/10

sm: A sokoban game with 15 challenging and entertaining levels in 10 lines ?! Thoughtfully provides level skip codes, as well as on-screen help. Extensive player notes are provided. Uses some clever data compression tricks, explained in a detailed and entertaining dev write-up at https://www.cole-k.com/2023/02/21/tiny-games-hs. Rating: 10/10

companion (Greg8128)

f-a: A chatbot which starts from a blank slate and should learn to speak mimicking your input. Despite my best effort the conversation was one sided. If the author could provide his transcript, that would be a nice way to showcase how the machine is learning. Rating: 5/10

sm: A chatbot that learns from your inputs, in seven lines of haskell code. Pretty cool, but perhaps I wasn't patient enough to see the best results. If it really will improve, more details of the "training" required, or a demo of a trained example, would be motivating. Rating: 4/10

hangman (kukimik)

f-a: A faithful hangman implementation. Uses the same unicode trick of call-by-push-block to achieve a pleasant guessing experience. Cute ASCII art. Rating: 7/10.

sm: A fun hangman game, drawing the hanged man as you make wrong guesses. I don't know how many words it knows. Minimal docs. Uses some clever tricks, including unicode-based compression and the CPP TIME macro. Rating: 8/10

quine (tristanC)

f-a: A quine! I am always fascinated with these, reminds me of Oulipo literature. This too can go in the “postmodernist” category Rating: 7/10

sm: A quine, which is a tricksy kind of program that prints exactly its own source code. Also provides a readable source version. See also the dev write-up at https://tristancacqueray.github.io/blog/tiny-game-engine. Rating: 7/10

Base

timing (TravisCardwell)

sm: An unusual tiny game: one implemented with perfectly normal, ungolfed haskell code. As a result, half of the program is boilerplate (shebang, stack line, imports..) and half implementation. This game tests your ability to estimate 30 seconds. Simple and effective, a good first game to study or to write! Rating: 6/10

f-a: A surprisingly fascinating game which shows how the barest of mechanics can be nontheless fun. Your task is simple: press , wait 30 seconds, press again. How hard can it be? Still, lot of fun, with my best score being You waited 30.39618408700335 seconds, beat that! Bonus points for clean code. Rating: 7/10

shoot (migmit)

sm: Our closest entry to Missile Command! In this game you are the attacker, not the defender. I think numbers appearing on the bottom line are targets, to be blasted with rockets from above before they count down to zero. Instructions are minimal and success/failure is not obvious, so I was a bit confused. Rating: 5/10

f-a: A very interesting game with split commands: your left hand to decide from where to fire and the right one to direct the missles. README is a tad short and I am not exactly sure what the numbers/*/X on the bottom of the screen represents, but the action is solid an I had fun. Rating: 7/10

log2048 (Lysxia)

sm: Not completely self-contained (no room for a shebang line), probably because of the luxurious use of spaces for readability. No instructions, which caused me trouble. Here are the ones from an online 2048 game: "Use your arrow keys to move the tiles. Tiles with the same number merge into one when they touch. Add them up to reach 2048!" This one is different, being in base 2, I believe. The movement keys are h j k l (VI movement keys ? I think so), plus enter after each press. Unfortunately like time-pressed reviewers of old, I couldn't figure out exactly what's going on here. Once you do, I expect it's a nice puzzle game. Rating: 4/10

f-a: A clone of the famous 2048 game. I had some trouble playing this as I did not check the original when it came out. The action is a bit different here, you do not “slide” but more “tilt” the board so all numbers (log₂) move to that side. Once you get this, it is very fun to try to match numbers together or try to work them in a position where you can pair them. Rating: 7/10

rhythm (elderephemera)

sm: Guitar Hero in the terminal! Prompts you for speed (0-9) and "keyset" (0-2) at startup. Read the help (./play rhythm -h) to discover the keys, or just press the keys that are shown on screen. You should press only when they are below the hit bar - green indicates you are in time (and your score goes up; twice as fast if you are on a winning streak), red indicates a miss (and your score goes down). A nice real-time feel. The game never ends; your score just goes negative. Suggestion: play a favourite music track along with this game. Rating: 6/10

f-a: Guitar hero clone and a very fun one! The author managed to cram in ten lines not only the game, but even multiple keysets — check the README! — and a “speed” setting. It plays smooth, it has colours, a score counter; graphically minimal and clean, thumbs up for me! Rating: 8/10

peyton-says (gergoerdi)

sm: A tiny version of the classic Simon electronic game, and an homage to our revered general Simon Peyton Jones.. Repeat the ever-growing sequence of digits shown by the game, for as long as you can. Not real time - you can take as long as you like for each keypress. I appreciate that it doesn't require pressing enter. Alas the random generator needs more platform testing, eg on mac SPJ says nothing but 11111... Could be a fun brain exercise when fixed. Rating: 4/10

f-a: A variation on the old Simon game. I had much fun playing this: it is a surprisingly cosy game, the action is clear and interesting for longer than most other 10-line productions. Rating 7/10

acey-deucey (trevarj)

sm: A classic from the BASIC era, discovered by many as the first game in David Ahl's BASIC Computer Games (1978). Nicely documented. Nice handling of invalid input. Unfortunately, randomness needs more platform testing, eg on mac Dealer always turns up a 2. With this fixed, it should be fun. Rating: 4/10

f-a: A simple gambling game: the dealer will show two cards and you have got to bet wheter a third hidden one will be “inside” the range of the first two. I say have becuase there is no turning back in acey-deucey, you always have to bet; be considerate and don't gamble your mortage payment on slim odds. The game could have benefitted from some kind of clear-screen function (as now the display is a bit messy), but it is playable and fun while your bankroll lasts! Rating: 6/10

flower-seeds (tristanC)

sm: Not a playable game; displays a lovely spiral of hearts, for St. Valentine's day. If only they had been red. :) Nicely documented, with readable source version and a linked video to study. See also the dev write-up at https://tristancacqueray.github.io/blog/tiny-game-engine. Nice real-time updating as you adjust parameters. Rating: 7/10

f-a: A weird ten-liner that I appreciated a lot. It is not really a game, more than a render/demo of a geometrical shape made out of hearts. What makes it fun is that you can control the display parameters in real time, interesting to see how the structure changes. Rating: 7/10.

lambda-ray (tristanC)

sm: Not a playable game; displays a large Haskell-logo lambda, rotating rather majestically in the terminal. Nicely documented, with verbose source and links to study. No shebang line; every one of those 10 lines was needed. Rating: 8/10

f-a: Another rendering demo, and another one with the haskell logo (λ + >>=). There is a fast version and unminified code explanation which is interesting enough. Rating: 6/10

7up7down (akshaymankar)

sm: Bet on dice rolls. You must type "7", "7up", or "7down" each time, which is a little tedious. Implements game quitting, so you can take your winnings and declare victory. Nicely documented, with dev notes. Rating: 6/10

f-a: Another casino game, a simplified version of Craps/Seven-eleven. Eight-liner, interface is a bit clunky (you need to type your prediction longhand) and dice icons a bit too small on my terminal. Bonus: unfurled code, taunting if you lose all of your money. Rating: 5/10

snake (akshaymankar)

sm: A turn-based snake game. The snake gets longer when it eats the thing. The play area wraps around, and there's no dying, so it's more of a relaxation than a game. Nicely documented, including notes on real snakes. Rating: 6/10

f-a: Snake clone. Since it is not in real time you will enjoy this better if you can play to your metronome or some kind of fast-tempo music. Fun part: the snake can cross itself without dying. Rating: 6/10

woosh.caves (Kindaro) 🏅

sm: The first of several variants of a cave-diving game (woosh.* and swish.*). How far can you go, avoiding walls and dead ends within a fiendish cave system ? Note the cave shape is persistent, so you can learn it to progress farther. woosh is turn-based, not requiring fast reflexes. a s d to steer left, down or right. In woosh you can Hold the key to engage afterburners - useful for familiar regions! Not much documentation but includes an unminified source version for study. Uniquely among these tiny games, woosh (and swish) come with a build script which can generate and minify new game variants based on a config file. Uses some non-roman unicode glyphs as abbreviations, which look cool (and might be mnemonic ?) Rating: 9/10

woosh.forest (Kindaro)

sm: Another variant of woosh, using double-width emoji characters. If you are in a terminal with a nice emoji-supporting font, you will be a cute kitty wandering through a forest. I wasn't able to get very far through this forest - is there a path I've missed ?! Rating: 7/10

f-a: This is a ski/descent/avoid type of game which greatly benefits from its procgen algorithm. The task is simple, descending in a deep forest (with many many many intricated paths) while avoiding hitting the trees themselves. The “trails” (in woosh.caves = caverns) shape is what makes this game unique and enjoyable. They are really nicely plotted and unique to look at, so much that I took pauses — no need to pause actually, it is a turn based game — to admire the scenery. Sometimes you select the wrong road, and realise only after that keypress that there is no exit. You are then hopelessly guiding your feline to an untimely death; a more developed and touching plotline than 95%+ of Steam games. Rating: 8/10

Default

sm: A typing speed test! How fast can you type the letters a to z ? I had some doubt about rules; the readme says "Alphabet should be written in order, without failure." Command line flags are supported, selecting four difficulty levels, allowing 10 seconds to 3 seconds. When time is up you'll be shown what you typed, and a percentage score. Simple and stressful! Rating: 6/10

f-a: A game where you have to have to type the English alphabet, in order, without failure, in the allotted time. There are four difficulty levels and I failed multiple time at the easiest one. Anxiety inducing! Rating: 5/10

shmupemup (elderephemera) 🏅

sm: One of three shoot-em-ups in this contest: this is an unusually hectic terminal game, a Defender-esque shooter with lots of moving objects, all of them fatal! It's just as well you are armed with a powerful laser. WASD to move, space to shoot. Nicely documented with running, playing, and dev notes and a readable source version. This game very cleverly implements a lot of animation and game logic by repeatedly parsing the whole playfield, which is probably key to its small size. Avoid the slight flaw that it's fairly easy if you hold the fire key and don't move much - instead dive in and fly as in the Quantum Asteroid Field! Rating: 10/10

f-a: An unicum (horizontal side-scroller) in the competition, shmupemup is packed with action (and artifacts while updating the screen on slower terminals). It is quite a substantial production for a ten-liner and the interesting README explains everything in its gory details. The game itself is good to play if a bit too easy after a while. Rating: 7/10

tsp (tristanC) 🔷

sm: This is a cool real-time arcade game in essentially one screen line! Join the Tiny Space Agency and fly your delivery ship to orbit and back as fast as possible. It won't be comfortable.. it won't be cheap.. but it will be fast. Assuming anything survives your landing. Nice docs with detailed play instructions and readable code version. See also the dev write-up at https://tristancacqueray.github.io/blog/tiny-game-engine. A quick and satisfying game to play with plenty of challenge in reaching higher scores. Rating: 9/10

f-a: Cute game in the “thrust” genre. Not immediate from the README, controls are f and r. You need to pilot your ship from base, to deliver curry to Tiny Space Station and return back in one piece. The only mechanic is “don’t fly too fast or you will crash when landing”, but it is a very good mechanic and you will feel accomplished succeeding. Among the terminal games, the layout of this one (a single, long stripe) is unique. Rating: 7/10

lol (hellwolf)

sm: This "game" is in fact an enhancer of other games. In the spirit of the lolcat program, lol can add rainbow colours to the other games in this collection (most but not all of them). This is rather clever and I don't know how it is done; I assume magic. Run eg ./play lol ski to see a basic effect. Additional lol arguments give different effects. Run ./play lol -h to see the docs, or see the fine dev notes at http://miaozc.me/2023-02-27-hs-tiny-games.html. Terminal games can look bland, but lol adds zest, so try it with your favourite games! Rating: 9/10

f-a: Meme mod for (almost) all terminal games to get that Nyan cat vibe your production deserves. No readme, imperscrutable code, 100% kaleidoscopic. Rating: Mondrian/10

space-invaders (meooow25) 🏅

sm: Another shoot-em-up, an homage to the first in the genre: Space Invaders! A and D to move, space to shoot. This tiny version feels good, is instantly recognisable and can still induce panic! Comes with docs and readable source version. Quite challenging! Rating: 9/10

f-a: A Space Invaders clone too ambitious for a ten-liner, you say? Not for meooow25! The game flows nicely, controls are easy to get, screen refreshing not super-smooth but appropriate to the game setting (a lone man on outdated technology trying to zap alien spaceships, maybe?). README contains easy-to-follow unminified code (with minified vars reference too!). It was fun, it was hectic, it felt great to beat it! Rating: 8/10

swish.easy (Kindaro)

sm: Like woosh, swish is about piloting your ship as far as you can through a fiendish (but learnable) cave. But swish is an honest-to-god exciting fast-paced arcade game. This "easy" variant is fun and not particularly easy. The collision detection felt a little unfair in tight spots, or was it just pilot error?! Minimal documentation, but as with woosh there is an unminified version and a build script to generate new variants based on a config file. Rating: 8/10

f-a: Very good descent game, you can say a woosh with real-time added! Very fluid action, yet for some reason I preferred the cosyness of whoosh. I believe there are some bugs in the logic as I died multiple times while adjacent to a block but not overlapping with it. In any case good production! Rating: 7/10

swish.survival (Kindaro) 🔷

sm: A more challenging variant of swish, with longer tunnels and more dead ends. Rating: 9/10

f-a: See above.

lc (byorgey)

sm: A puzzle game for computer scientists; you are provided a series of equations and must define lambda calculus functions to implement them. I believe it provides about a dozen such puzzles. Comes with readable source version and good docs, which you will need to study! See the README or run ./play lc -h. I must admit to not completing a level, but I suspect you will find a rather tough and good brain workout here. Recommend enhancing with lol. Rating: 7/10

f-a: A game similar to expressit. You are living the escapist fantasy of being a computer scientist. Your task? Write lambda calculus terms to fit the bill. The premise are interesting, the game itself is really challenging. The author had to use De Bruijn indices (forced choise, there isn’t a single space wasted in the code!), this was not easy for me to digest as a player. If you want to enjoy this I recommend fetching pencil, paper! Rating: 6/10

Hackage

guess2 (sm)

f-a: N/A judge made, test game.

sm: Guess the number. A golfed version of my first Haskell game (made for the LA Haskell Users Group in 2013). Rating: my entry

wordle (halogenandtoast)

f-a: Only nine readable lines for this beauty, for a game we all love. Interface could make slightly better by adding a prompt right when the game starts and/or providing a README. Once you get that, it is quite playable (and replayable, with nine possible words) and well behaved! Rating: 6/10

sm: A working game of wordle. No docs, no on-screen prompt; just type a word and watch for clues in the form of o (right letter wrong place) or x (right letter right place). Could have included more words for more replayability. Rating: 5/10

ski (sm)

f-a: Thrilling, fantastic action-packed game which will not give you a moment to catch your breath. Control a nameless skier and guide him to avoid his doom. In the README a code guide and tips for tricky terminals, thumbs up! Rating: N/A judge made (but recommended)

sm: Of my entries, the one I like playing. Steer left and right with AD. Best played in a terminal and font which will show a nice tree emoji, may not look right otherwise. This is a classic game from BASIC days, traditionally one of the simplest action games to implement since most machines and languages can scroll text upward quickly. Interestingly, on a modern mac that's not true in the default Terminal app or the current iTerm release; the emoji slows it doen horribly. Be sure to use a better terminal app like iTerm 3.5 beta or newer, or VS Code's terminal. Rating: my entry

guesscolor (TravisCardwell)

f-a: Unique game the pack, asking you to guess a colour in its RGB representation. It is surprisingly tricky (my scores started from 60, slightly improving each game). Good idea, would love to use HSL representation too (which I am sure tha author thought of, but alas only ten lines). Rating: 6/10

sm: A novel game using gloss to display a color, testing your estimation of its RGB components. No prompt on the terminal; enter R G B as three space-separated 0-255 numbers. Like Travis's timing entry, this is implemented with perfectly readable unminified Haskell code. Rating: 7/10

bulls-n-cows (akadude)

f-a: In medias res game which might have benefitted from some ingame instructions or a README. bulls-n-cows is a guessing game, similar to some tabletop games of the past. Provides a decent gaming experience once you get the hang of it. Rating: 6/10

sm: A number guessing game with clues, like wordle for four-digit numbers. No docs. Enter four digits to see clues, bull means right number right place, cow means right number wrong place. Rating: 5/10

hallway-to-hell (juliendehos)

f-a: Another — aptly named — “don’t hit the walls” game. Less hectic than ski, easier on your coronaries, more compact than ski and without emojis, hence playable on every terminal. I praise the minimal (but clear!) README and almost readable minified code. Rating: 7/10

sm: Another piloting game, unusual in that you are flying upward. A little flickery as a result but the direction feels natural. AD keys to move left and right. The tunnel gets progressively narrower, so there's no winning here. When you hit a wall the game hangs, not printing a score alas. The code is readable. Rating: 6/10

1234-hero (gelisam)

f-a: A very good production, which gets away from the terminal. 1234-hero is a game in the spirit of Guitar Hero. As a judge I liked the clever way of putting controls infos in the title, clean interface, good mechanics (not easy to press keys on time!). Excellent! Rating: 8/10

sm: A graphical rhythm game using gloss. Press 1234 as each note crosses the bar to increase your score. As you get the timing right it gradually accelerates, creating a nice rising tension! Rating: 8/10

crappy-flappy (gergoerdi)

f-a: Another game inspired by a classic (Flappy Bird), crappy-flappy sports gentle action. It is a one-button game, controls are super easy to get even without checking the README, and accessible to most. Simple but not trivial, it felt great guiding the warm-blooded vertebrate to safety. Rating: 8/10

sm: A nice terminal version of Flappy Bird. Feels and looks good, at least with my unicode font. Simple one-key control: just hammer the space bar to stay aloft and fly across the screen, through the gaps. No scoring - game ends when you crash or when you win. Rating: 7/10

pong (gergoerdi)

f-a: Clone of one of the famous games of the past, you start the game with your paddle almost covering the whole height, but don’t let that trick you: the ball is fast, your movement slow, it will not be easy to keep the game going. Rating: 6/10

sm: A nice clean-looking classic pong game, at least with my unicode font. Bounce the ball against a wall as many times as you can, using WS keys to move your bat up and down. Score is displayed in-game and afterward. Quite challenging - the bat moves slower than the ball, you'll need to hold down the key but that also speeds up the ball. I like it! Rating: 8/10

minesweeper (Greg8128)

f-a: Minesweeper clone with clunkyness added, since we do not play with a mouse but by inputting coordinates on a keyboard. Quite nice that the player can choose a larger/smaller board and the number of mines (based on how lucky they feel in that particular day). Good mechanics explanation (with a “transcript”) in the .hs file. Rating: 5/10

sm: Minesweeper. Enter width, height, number of mines, then successive x and y coordinates as you try to clear the mine field without going boom. Rating: 6/10

pong2 (sm)

f-a: Like pong, but on speed. Very difficult to keep the ball in play, I succumbed after a couple dozen seconds. Good to see unminified code. Rating: N/A judge made

sm: A second one-player pong game, this one with bat at the bottom. Like the other pong, challenging because you sometimes need to hold the key but then the ball speeds up; this one is faster and harder. Some display bugs but playable. New games start automatically, and high score is displayed. Rating: my entry

brickbreaker (fgaz) 🔷

f-a: Another pong/arkanoid inspired game, and in my opinion the best of the lot. First of all the game is mouse-controlled, which is a way more comfrortable experience than keyboard controls. Plus you actually destroy bricks and have an ominous red splash on failing to keep the ball in bounds. Even more: catchy alliteration in the title, a yak-shaving minifier, graphics, README with tips on how to modify the code. Rating: 9/10

sm: A good minimal graphical breakout game - using your mouse to control the bat, bounce the ball to destroy all bricks, aiming for the green screen of victory, not the red screen of failure. At game end, press the ESCAPE key to exit. A "soggy" ball-bat bounce hurts the game feel. Comes with docs and a readable source version. Rating: 8/10

lazy-march (tristanC)

f-a: Not a game but a demo implementing a ray-marcher in ten lines. The spinning lambda looks cool enough, there is uniminfied code to learn from and references to the algorithm. Rating: 6/10

sm: An animation similar to lambda-ray, but showing a generic lambda rather than the Haskell logo lambda. Comes with docs and a readable source version. See also the dev write-up at https://tristancacqueray.github.io/blog/tiny-game-engine. Rating: 7/10

f-a: Another game that will take its time to compile, but it is worth it! The most unique game of the competition, you will take the role of an accountant to guesstimate the balance in your financial statements. Can you keep them Credit/Debit transactions in your mind? Financial freedom awaits! Remember that you need an hledger journal for this game to work. Don't have one (yet)? Check the README! Rating: N/A judge made

sm: This "game" bridges two of my hobbies, Plain Text Accounting and game development. Mainly of interest to hledger users (or someone wanting to learn an organisation's finances), it reads a hledger journal and tests your knowledge of account balances (just liquid assets and liabilities), with the goal of improving your financial situational awareness. Comes with a readme and readable source version. Rating: my entry

vaders (gergoerdi)

f-a: Space invaders clone made slightly more difficult by the facts that ammo is scarce, aliens in droves and movement slightly weird (you don’t have “move” keys, but “change direction” keys). Solid shooting experience, graphical, admission of space leaks in the README. Ratings: 6/10

sm: The third shoot-em-up in this contest, a graphical one using gloss. Shoot down invading enemy ships. You are always moving; AD keys to change direction, . (period) key to shoot. A clone of one of the BASIC 10Liner entries - see nice video link in the readme. Lacks the original's time mechanic. Unfortunately, the playfield was too large for some displays (eg a macbook air), causing the player's ship to be offscreen. (Now fixed, so this is now playable.) Rating: 4/10

tetris (gergoerdi)

f-a: Tetris clone, fast Tetris clone. You will have little time to think, so get ready for a flurry of pentominos clogging your screen. Ratings: 7/10

sm: A fast and hard version of Tetris! JL keys to move the falling piece left and right, K to rotate it, hold space (eg) to drop faster. No scoring alas, just survival. Uses unicode glyphs, may require a good unicode font. Another game capable of creating panic in the terminal - good to see! Rating: 9/10

short-guess (RimuhRimu)

f-a: Simple “guess the word”, one of the few games where you won’t get claustrophobic looking at the source. Difficult to beat. Rating: 5/10

sm: A word guessing game, like hangman without the hanged man. Note you should guess one letter at a time, not the whole word. It will show letters guessed correctly. Source is readable. This knows only a few different words so won't hold your interest, but it earns an extra rating point for being the first project of a brand new Haskeller! Rating: 6/10

hexescape (nevrome)

f-a: An embryo of a survival horror, with the novel touch of playing on a hexagonal board. Available directions are displayed at every turn, which is a bonus, and we can see clever usage of emojis. I really enjoyed the author took some time to write a few lines of backstory in the README; I found movement challenging and mechanics lacking. Rating: 5/10

sm: The only entry with its own cool game art (see banner in the readme; AI-generated). Requires a unicode font for correct display. Use the number keys to move around an unusual hex grid, looking for the exit before you run out of hit points; if the game prints 🪜, you have found it and won A miniature adventure with a definite outcome! Movement is challenging because the keys change based on your location. Comes with a readme and readable source version. Rating: 7/10

snake-lemma (gergoerdi)

f-a: Snake clone. Aesthetically the author uses a 2×1 character cell which makes the visual experience enjoyable, plus we have a number of characters taken from various lamdba calculi to tickle type theorists out there. Fun! Rating: 7/10

sm: A math-themed snake game. IJKL keys to change direction. Smooth, speedy and increasingly tense as your snake grows larger! A score is printed when you die. Rating: 9/10

subpar-hexagon (gergoerdi) 🏅

f-a: Wow, the most trippy experience of them all, an abstract game where you have to move on the edges of an hexagon to avoid hitting red walls closing on you. Each turn only one side is safe! Very good graphics, a score counter which is part of the experience (making you proud and distracting you at the same time), clear instructions in the .hs, I enjoyed this! Rating: 9/10

sm: A minimal, stylish graphical version of Super Hexagon! Use the AD keys to manouever your dot out of endless enclosing hexagons. Players of that game will find this one a little easier, but still challenging. The pulsing animation and floating score create a pleasing arcade feel. Your score will reset as soon as you die, so you have to keep an eye on it. As with the other gloss games, press ESCAPE to quit. Rating: 10/10

Winners

And here are the winners of the first Haskell Tiny Game Jam as chosen by your judges!

Honourable mentions

Category winners

Contest winner

And the overall contest winner is...

Our hats are off to you. GLORY IS YOURS!

How to play

For now, playing these games requires typing commands in a terminal window to install and run Haskell programming tools. If you don't want to do this, check back here in future; perhaps easier install methods will become available.

First, get a copy of this github repo:

$ git clone https://github.com/haskell-game/tiny-games-hs
$ cd tiny-games-hs

You will also need the ghc compiler (9.2.5+ or 9.4.4+ recommended) and the stack build tool (or, the cabal build tool and a little know-how). You can install these easily using the ghcup install tool; see https://www.haskell.org/get-started .

Now if you have bash, and Haskell installed, you can run ./play in this repo to list and run games:

or:

or ./play GAME -h to view a game's source code and documentation if any.

If you don't have bash, cd into each */GAME directory and try running GAME.hs. If that fails, look for running clues in that file, a readme, or the play script.

Nix users: a flake.nix is provided; running nix develop . should give you a reproducible environment for running the games.

stack

Many of the games are implemented as stack scripts for reliable running and compactness. Some tips:

  • When you run a game for the first time, stack will automatically fetch the latest package database and install the required GHC version and haskell dependencies if needed. This can take a long time (eg minutes), up to 1-2G of disk space, and may or may not show progress output. The OpenGLRaw package required by the graphical, gloss-based games is particularly slow to build. If you need more progress output, you can add --verbosity=info to the game's shebang line (its first line, beginning with #!) or play command (its custom run command in the play script).

  • We have configured all games to use the same GHC version (from the latest LTS snapshot at stackage.org). If you have a similar GHC version/stackage snapshot already installed (or even a quite different one that you think might work), you can try using that instead so as to save on install time and disk space. In the games' shebang lines and play commands, change the --resolver argument to your already-installed stackage snapshot and see if they run.

Fonts

Some games use unicode glyphs, emojis and/or double-width characters. For best results:

  • Use a terminal with good support for double-width characters
  • And with a font configured that contains attractive unicode glyphs and emojis.
  • Mac users: don't use the default Terminal or iTerm 3.4 or less, they render emojis slowly. Use a faster terminal, such as iTerm 3.5 beta, or the terminal built in to VS Code.

gloss

Some games use the gloss library (and OpenGL) to show graphics. If you see an error message like "user error (unknown GLUT entry glutInit)", install the system package named "freeglut" or similar, using your system package manager.

To quit gloss-based games, press the ESCAPE key.

lol

The lol entry is a meta "game" that colourises other games, in the spirit of lolcat. It works with most of the games but may cost a little performance. Hint: each extra "lol" argument modifies the effect.

Contest rules

Entries were submitted in the last three weeks of February 2023. The #haskell-game Matrix or IRC chat and this repo's issue tracker were used for discussion/help/feedback/announcements.

These were the contest rules for this round:

  1. You can submit any number of entries to the official repo, haskell-game/tiny-games-hs. Each should be a playable game or amusement in one haskell file of up to 10 lines of up to 80 characters each, in one of the following categories:

    • prelude-10-80, allowing no imports
    • base-10-80, allowing imports from the base package
    • default-10-80, allowing imports from GHC's default packages, plus an optional file named Import.hs to gather and re-export imports (only)
    • hackage-10-80, allowing imports from all of Hackage, and an Import.hs file.
  2. The entry can be a script (runghc, stack, cabal, ...) or a small program requiring compilation, but not a multi-file project. Our ideal is a self-contained executable 10 line program that just works, like BASIC programs. Here are some templates to give ideas: prelude/template1, base/template1, default/template1, hackage/template1

  3. Unlimited comments are permitted after line 11. The game's category/gamename (author) info should appear here, plus any essential info like player controls, so that the game is usable to someone seeing just this file.

  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 (these use up your line count, but improve runnability; env -S is allowed) or contain a reliable build/run command line with all needed options, in the comments (the play script will use this). Games which aren't straightforward to run and enjoy are incomplete. See also the runnability tips below.

  5. The game should be portable, running on all major platforms, ideally.

  6. A square thumbnail (screenshot) must be provided for the repo README - either a static png (which will be hyperlinked) or an animated gif (which should not be, so as not to break Github's player overlay).

  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. An unminified version of the code, easier to read and learn from, is optional but welcome.

  9. You can update your entries freely until the contest end, 2023-02-28 23:59:59 UTC, at which time they are frozen (in the contest branch) for posterity and judging (no exceptions except minor updates at judges' discretion, eg metadata fixes). Also the last commit received before deadline has been tagged with the pre-deadline tag. If you need to share post-contest improvements, you are welcome to keep publishing updates in the main branch. The main version is the one that will be presented to players.

Development tips

Tips for developers while the jam was in progress, and for future jams.

Runnability

  • 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 #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 #38).
  • stack scripts can use --verbosity=error to silence the "Selected resolver" output. (Or --verbosity=info to show dependency building progress.)
  • If using packages which require compilation (gloss) or more speed, use stack script --compile or stack script --optimize. (Downsides: creates .o and .hi files; a compiled binary with newer timestamp than source can cause confusion.)
  • 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 very slowly; iTerm 3.5 beta or VS Code terminal work better.

Minifying

The developer blog posts below have many minifying tips.

Here are some minifier tools you can try; either or both may be able to turn your game into a brick of inscrutable code no more than 80 characters wide.

  • hackage/brickbreaker/minify.hs (from #63; contact @fgaz). This minifier requires that you first add curled braces and semicolons throughout your code to make it white space insensitive.

  • minify.hs (from #14; contact @kindaro with issues/feedback). This minifier:

    • automatically adds curly braces for you so long as you put the line module Main where into your source file. (This line will then be automatically removed, so you lose no space.)
    • automatically replaces variables and constructors surrounded with curly braces {example} with single letters, for extra minification.

Animations

Here's one way to make animated GIFs or APNGs for your README (see also ski/Makefile):

# Install Noto Emoji font, required by agg to show emojis
$ asciinema rec game.cast
$ agg -v --cols 80 --rows 25 --font-family 'Essential PragmataPro' --font-size 16 game.cast game.lg.gif
$ gifsicle -V --lossy=50 -k8 -O2 -Okeep-empty game.gif -o game.gif
$ gif2apng game.gif game.png

agg doesn't show colour emojis yet. The Noto Emoji glyphs are monochrome and less pretty, but will give the idea. (asciicast2gif which predates agg does show colour emojis, but doesn't convert ansi-terminal-game output well.)

Shrinking the gif, eg with gifsicle, is recommended for repo longevity and page load times. It helps gif2apng a lot also.

APNGs are preferable if you can manage it: they will not be obscured by Github's gif player button, they can be hyperlinks, and they can have smaller file size. https://sourceforge.net/projects/gif2apng works well, it can be built from its source tarball.

Discussion

General:

Game jam:

Results:

Developer blog posts:

tiny-games-hs's People

Contributors

akshaymankar avatar bradrn avatar byorgey avatar cole-k avatar elderephemera avatar fgaz avatar fizruk avatar gelisam avatar gergoerdi avatar greg8128 avatar hellwolf avatar juliendehos avatar kindaro avatar lsmor avatar lysxia avatar meooow25 avatar migmit avatar nevrome avatar rens-van-hienen avatar rimuhrimu avatar simonmichael avatar traviscardwell avatar trevarj avatar tristancacqueray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tiny-games-hs's Issues

Detect freeglut availability in play command, and help section for Nixos user regarding freeglut

Would it be a good idea to add this advisory warning to the play command?

function detectAndWarnAboutGlut() {
  (LIBRARY_PATH=$LD_LIBRARY_PATH gcc -lglut --shared -o /dev/null &>/dev/null) || echo 'You should install freeglut in order to play some games'
}

Additionally, for NixOS user, this command may be useful, and can be added to README:

$ nix-shell -p freeglut # or install freeglut
$ export LD_LIBRARY_PATH=`nix eval --impure --raw --expr 'let pkgs = import <nixpkgs>{}; in pkgs.freeglut'`/lib;

log2048 permits illegal moves

Like this:

....
....
.001
0112

j
..0.
....
.001
0112

Not sure what my point reporting this is 🤷 Call it a habit 😁

But looks like a bug to me.

animated pngs

I see (and thought I saw a comment from @fgaz, but can't find it) that you can make animated PNGs, and these can be hyperlinked / displayed without player button on github. (See brickbreaker on README.)

I think that's better ? I'm not sure which tools are available for animated pngs, but I assume they exist. Maybe someone wants to convert all the gifs to pngs ?

Trouble running matchmaking

Hi, I'm having some trouble getting "matchmaking" to run.

$ ./play matchmaking

prelude/matchmaking/matchmaking.hs:1:2: error:
    parse error on input ‘#!/’
  |
1 | #!/usr/bin/env -S runghc -cpp -DD=a=replicate;b=putStrLn;c=length;p=map;u=max(2)
  |  ^^^

Same error if I run the file directly. (I thought maybe the shebang shenanigans were tripping up the play script.)

$ prelude/matchmaking/matchmaking.hs 

prelude/matchmaking/matchmaking.hs:1:2: error:
    parse error on input ‘#!/’
  |
1 | #!/usr/bin/env -S runghc -cpp -DD=a=replicate;b=putStrLn;c=length;p=map;u=max(2)
  |  ^^^

I'm running this in shell set up with the Nix flake.

Confusion about the default/template1.hs

Maybe it's because I'm new to the haskell language and its environment, but when I started my game with the default/template1.hs, It starts with the random package, and when I submitted my game, I was told that the random package generally does not come with GHC #73 , so it should be moved to the hackage/category (I originally placed the game in the default category). So, my question is: Why does that template include the package random or why is default/template1.hs placed in the default category?

Why no `Imports.hs` for the `base` category?

It seems unfair that people that choose to compete in the default category get to use more packages and also get more lines!

It is kind of hard to say in what sense exactly this is unfair, since there is no formal competition between categories. But I can try to make this precise like so:

  1. Any game fit for base also fits for default — it is vacuously true that it uses only default packages.
  2. I can therefore move any game built for base to default and get to move imports to Imports.hs and gain more lines. This is a clear advantage in the terms of taking the most out of the system.
  3. Therefore, if I am working on an idea for a game, my only incentive to keep it in base is to reduce competition. This puts everyone who chooses this category in bad light.

Another reason is that base has a lot of modules. It is hard to take advantage of them without using Imports.hs. In default you get to import any number of modules, but in base only a small amount. This seems like an arbitrary handicap to the category base itself.

So, this is unfair not to any individual competitor, but to the whole category base, for the above two reasons.

The above notwithstanding, I think it would be bad sport to change the rules now. Maybe the next competition can ameliorate this?

include non-games ?

We have a couple of impressive non-playable-game entries.. call them demos. These are very much in the tradition of what you'd find in a BASIC "games" folder. But our rules call for "a playable game" and we call this a "game jam".

Should we change the rule to say "a playable game or amusement", officially including non-games in the judging ? Or leave things as they are for this round ?

Scores instead of places?

I suggest that games be assigned scores by judges. This way people will be incentivized to try harder even if their odds to get to the first place are slim, and the score will inform the designer better than just a place number.

This is indeed how creative performances are often scored, for example figure skating.

Technically games in lighter categories also fit the heavier categories, so they should compete there as well!

Given a game that works with Prelude alone, surely I can:

  1. Add a spurious import to put it formally into the base category.
  2. Create a file Imports.hs to put it formally into the default category.
  3. Import something weird to put it formally into the hackage category.

I can further obfuscate that these imports are spurious by using them in some way, I can rename the game, create fake accounts to avoid detection, and so on.

That is to say, any game is technically qualified to compete in all categories heavier than it specifies. Plausibly a brilliant game in the prelude category can win all 4 nominations.

I say this is fine — lighter games are at a disadvantage anyway, so, if one manages to win in more than one category, this only shows how good it is. Let every game compete automatically in all categories heavier than its own!

Imports.hs -> Import.hs

The rules specified the file name should be Import.hs. Half a dozen entries used Imports.hs and we didn't make a fuss about it. Now I'm going to rename those just to make my life easier.

type-and-furious: could not load Imports

A runnability issue: currently it can't be run from outside the directory.

~/src/tiny-games-hs$ default/type-and-furious/type-and-furious.hs 

default/type-and-furious/type-and-furious.hs:2:1: error:
    Could not load module ‘Imports’
    it is a hidden module in the package ‘http2-3.0.3’
    it is a hidden module in the package ‘http2-3.0.3’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
2 | import Imports;printSec sec=do{when(sec>=(-0.01))$do{printf
  | ^^^^^^^^^^^^^^

shebang line issue (missing -S)

An example:

git: main node: v16.18.1 ghc: 9.2.6 
nix-shell$ ./play survival
/usr/bin/env: ‘runghc -XUnicodeSyntax’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines

Complete list:

nix-shell$ egrep '/usr/bin/env \w+ .*' */*/*.hs 
base/woosh/woosh.caves.hs:#!/usr/bin/env runghc -XUnicodeSyntax
base/woosh/woosh.forest.hs:#!/usr/bin/env runghc -XUnicodeSyntax
default/swish/swish.easy.hs:#!/usr/bin/env runghc -XUnicodeSyntax
default/swish/swish.survival.hs:#!/usr/bin/env runghc -XUnicodeSyntax

Comment on shebang line does not always parse

Comments on shebang lines are not portable, as they cause failures on many systems. Here is an example using GNU/Linux:

[tiny-games-hs] hackage$ head -n 1 wordle.hs 
#!/usr/bin/env stack  # gam-10-80-hs-default/wordle (halogenandtoast)
[tiny-games-hs] hackage$ ./wordle.hs 
/usr/bin/env: ‘stack  # gam-10-80-hs-default/wordle (halogenandtoast)’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines
[tiny-games-hs] hackage$ env --version | head
env (GNU coreutils) 9.1

Moving Games to categories they belong.

Hi, I think the some games are wrongly labeled as hackage category:

  • ski
  • bulls-and-cows
  • guess2
  • wordle

they should belong to default category since they only use randompackage aside from base. Also I'd suggest to move every game to its own folder, hence:

  • hackage/bulls-and-cows
  • hackage/guess2
  • hackage/wordle
  • prelude/guess1
  • prelude/pure-doors

should be move to individual folders

Nix scripts?

Wouldn't a nix script qualify? E.g.:

#!/usr/bin/env nix-shell
#! nix-shell -p "haskell.packages.ghc92.ghcWithPackages(pkgs: with pkgs; [ blaze-svg ])" -i runghc
main = pure () {- various blaze-enabled things here -}

Shorter category codes ?

The category codes used at https://www.homeputerium.de are PUR-80, PUR-120, EXTREM-256, SCHAU. Ours, like gam-10-80-hs-prelude, were intended to fit well with non-games or similar projects in other languages, but are a bit unwieldy. It's not a big deal but I'm wondering about shortening them to

prelude-10-80, base-10-80, hackage-10-80

or

PREL-10-80, BASE-10-80, HACK-10-80

Question about minifying and unminifying.

Some of the submitted games have been compressed to adhere to the guidelines. Can anyone share their techniques for effectively compressing (minifying) the code, as well as the steps for decompressing (unminifying) them?

In future, could we standardise on one Stackage release/GHC version?

If I'm not mistaken, a given package has to be recompiled from scratch when used within Stackage releases that provide different versions of GHC, even if those Stackage releases provide the same version of that package. This is tedious for big packages like OpenGLRaw and OpenGL (required by Gloss), which have 617 and 118 modules, respectively.

E.g. in the "Hackage" category, there are currently 5 games that depend on Gloss. subpar-hexagon, brickbreaker and vaders use lts-20 which currently resolves to lts-20.12, which provides ghc-9.2.6. But 1234-hero and guesscolor depend on lts-20.9 and lts-20.10 respectively, which both provide ghc-9.2.5. All three of these Stackage releases provide the same versions of Gloss, OpenGL and OpenGLRaw, but you have to compile these packages twice to play all 5 games, as shown by the following find results in ~/.stack:

~/.stack$ find -name '*OpenGL*.so'
./snapshots/x86_64-linux/421f31cfbd7a29fd9683b239ebe038ea7ed253a81c18c767587fdac3fe33f982/9.2.5/lib/x86_64-linux-ghc-9.2.5/libHSOpenGL-3.0.3.0-LpkQwsfDHdiHgHtEdDmdo8-ghc9.2.5.so
./snapshots/x86_64-linux/421f31cfbd7a29fd9683b239ebe038ea7ed253a81c18c767587fdac3fe33f982/9.2.5/lib/x86_64-linux-ghc-9.2.5/libHSOpenGLRaw-3.3.4.1-EPDWBO8k5lU2hca04RVt4R-ghc9.2.5.so
./snapshots/x86_64-linux/d7e924c9b9c52692b18ee42f62cc80a86679258c7d0639a498d53431e5dc77d0/9.2.6/lib/x86_64-linux-ghc-9.2.6/libHSOpenGL-3.0.3.0-Flc3feNJNdTH21QxlWEV9w-ghc9.2.6.so
./snapshots/x86_64-linux/d7e924c9b9c52692b18ee42f62cc80a86679258c7d0639a498d53431e5dc77d0/9.2.6/lib/x86_64-linux-ghc-9.2.6/libHSOpenGLRaw-3.3.4.1-6yRM0UvXpbbL51pZqbkStV-ghc9.2.6.so

To be clear, I had never built a Haskell project that uses OpenGL before playing the games in this contest, and I added -v to the Stack command in 1234-hero to confirm that Stack was recompiling the OpenGL packages after it had compiled them for subpar-hexagon. I haven't played all of the games yet, but presumably the freedom of choice will lead to more unnecessary recompilations across all of them.

To avoid this in future, and the related issue of having to install multiple GHC versions (I currently have five, whereas I only had one before the contest), could we standardise on one Stackage release and GHC version?

Prohibit reading the comments section of the source file

Perhaps in future editions a rule should be included that the program submitted shouldn't read the comments section of the source file. This would probably by frowned upon by the judges anyway, but maybe it's worth saying explicitly.

env -S is platform-specific

On three entries (crappy-flappy, fifteen, pong) I just responded

Unfortunately I think we'll have to disallow env -S as it's not available on GNU/Linux (at least not until coreutils 9.x).

And in README I just added

Tips for rule 4 (runnability):

  • We must avoid arguments on the shebang line and env -S, which is not available on GNU/Linux, or at least not before coreutils such-and-such.

I imagine this will be bitter news for some. But achieving programs that "just work" is a core principle and very much part of the challenge, and env -S seems incompatible with this, alas.

What are your thoughts, do you see other options ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.