blocktran

Falling-block object-oriented Fortran game, resizable playfield

https://github.com/fortran-gaming/blocktran

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.6%) to scientific vocabulary

Keywords

game modern-fortran object-oriented-fortran tetris-game
Last synced: 6 months ago · JSON representation ·

Repository

Falling-block object-oriented Fortran game, resizable playfield

Basic Info
Statistics
  • Stars: 23
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 22
Topics
game modern-fortran object-oriented-fortran tetris-game
Created almost 8 years ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation Codemeta

README.md

BlockTran

DOI Actions Status

Text/console falling-block tetromino game written in object-oriented Fortran 2008.

BlockTran gameplay demo

  • user-configurable playfield size
  • Logs pieces played to blocktran.log so you can recreate memorable games.
  • uniform random game piece generation.
  • clean, object-oriented Fortran 2008 syntax
  • Curses (Ncurses, PDcurses) used for display, called directly from Fortran code.

Build

BlockTran works on Mac, Linux, native Windows, Cygwin, Windows Subsystem for Linux. Requires a Fortran compiler and CMake. Works at least with Gfortran, Flang, Intel oneAPI, NVHPC, ....

sh cmake -B build cmake --build build

If trouble building with MinGW / MSYS2 on Windows with Ncurses, try auto-building PDCurses:

sh cmake -Bbuild -Dfind=no --fresh cmake --build build

or using Fortran FPM:

sh fpm build fpm run

The main executable file is build/blocktran. You can copy this file to your Desktop or wherever you like.

Linux / macOS

Ncurses is required. Alternatively, PDCurses + X11 development libraries are required for building on Linux.

Install X11 on Linux:

```sh dnf install libX11-devel libXt-devel libXaw-devel ncurses-devel

or

apt install libmxu-dev libxpm-dev libxt-dev libxaw7-dev libx11-dev ```

on macOS:

sh brew install libxt libxaw libx11

Play

difficulty level

adjust cadence of falling blocks with -d option, including decimal point:

bash blocktran -d 1.2

Higher number increase difficulty. Must include decimal point.

Playfield size

specify width and height of the playfield with -s option:

bash blocktran -s 20 15

play against computer

The computer player is rudimentary.

bash blocktran -p 2

debug mode

Debug logging is enabled by:

bash blocktran --debug

Controls

Other "secret" cheat keys exist! You can also use arrow keys.

Key | Effect -----------|----------------------------- W | Rotate piece A/D | Left and right respectively S | Move down faster Q or Esc | Exit the game

Notes

Block distribution is uniformly random as confirmed by:

sh ./blockrand

References

Owner

  • Name: Fortran Gaming
  • Login: fortran-gaming
  • Kind: organization

Modern and resurrected Fortran games. Includes candidates for conversion to Fortran in other languages.

Citation (CITATION.cff)

cff-version: 1.2.0
authors:
  - family-names: Hirsch
    given-names: Michael
    orcid: https://orcid.org/0000-0002-1637-6526
title: Blocktran
doi: 10.5281/zenodo.5675727

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "license": "https://spdx.org/licenses/Apache-2.0",
  "codeRepository": "https://github.com/fortran-gaming/blocktran",
  "contIntegration": "https://github.com/fortran-gaming/blocktran/actions",
  "issueTracker": "https://github.com/fortran-gaming/blocktran/issues",
  "name": "blocktran",
  "identifier": "DOI: 10.5281/zenodo.5675727",
  "description": "Falling-block object-oriented Fortran game with resizable playfield",
  "applicationCategory": "Games",
  "keywords": [
    "object-oriented"
  ],
  "programmingLanguage": [
    "Fortran"
  ],
  "author": [
    {
      "@type": "Person",
      "@id": "https://orcid.org/0000-0002-1637-6526",
      "givenName": "Michael",
      "familyName": "Hirsch"
    }
  ]
}

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Dependencies

.github/workflows/ci_cmake.yml actions
  • actions/checkout v3 composite
  • msys2/setup-msys2 v2 composite