Glimmer Hangman Icon Glimmer Hangman 1.0.0

Glimmer DSL for LibUI Application

Gem Version

Hangman (word game) that runs on Mac, Windows, and Linux. Built with Ruby and Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library) using Application Scaffolding.

Implementation started at the RubyConf 2024 Hack Day Event for Glimmer DSL for LibUI, which was connected to the RubyConf 2024 workshop "How To Build Basic Desktop Applications in Ruby".

glimmer-dsl-libui-mac-hangman.gif

Setup

Assuming you have Ruby installed (standard MRI / CRuby).

Run:

gem install glimmer_hangman

Usage

Run:

glimmer_hangman

or just:

hangman

The goal of the game is to guess a word by typing letters on the keyboard one by one, with 10 guesses max.

As each letter is typed, the blanks are replaced with letters that gradually reveal the word being guessed if the typed letter is a correct part of the word, with multiple occurrences if any (e.g typing E shows E twice in a word that has it twice like RECOGNIZED).

correct guesses

Or otherwise, the drawing at the top shows more parts of the scene of execution by hanging if the typed letter is incorrect.

incorrect guesses

Also, typed letters show up at the bottom of the screen as green (correct) or (red) incorrect.

guessed letters

The game is won once the correct word is guessed completely.

guessed letters

The game is lost once the stick figure is fully hung (10 guessed letters are incorrect).

guessed letters

Restart game by:

  • Keyboard Shortcut: CMD+R on Mac or CTRL+R on Windows/Linux
  • Menu Item: Game -> Restart

Development

Clone project:

git clone https://github.com/AndyObtiva/glimmer_hangman.git

Change directory:

cd glimmer_hangman

Install project gems with Bundler:

bundle

Run application with glimmer command:

glimmer run

Or run using included binary script:

bin/glimmer_hangman

Package as a Ruby gem with glimmer command:

glimmer "package:gem"

Or package using equivalent direct rake command:

rake build

Generate updated gemspec with glimmer command:

glimmer "package:gemspec"

Or generate gemspec using equivalent direct rake command:

rake gemspec:generate

Contributing to glimmer_hangman

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

TODO

TODO.md

Change Log

CHANGELOG.md

MIT

Copyright (c) 2024 Andy Maleh. See LICENSE.txt for further details.

--

Built with Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library)

Glimmer Hangman icon made by Freepik from www.flaticon.com