Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gaiman

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gaiman

Gaiman Text based advanture games engine and programming language

  • 1.0.0-beta.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Gaiman Engine and Programming Language

Gaiman: Text based advanture games engine and programming language

npm Build and test Coverage Status LICENSE GPLv3

Gaiman: Storytelling Text Based Game Engine and Programming Language

Main part of Gaiman is a minimalist programming language and main purpose is to help create Text Adventure Games. But it can also be used to create any interactive CLI applications (Web Based Terminal applications). It support browser based CLI applications and in the future also native command line.

Installation

npm install -g gaiman@beta

Usage

gaiman -o directory input.gs

This will compile your source file and generate dir/index.html and dir/index.js files. And you can open generated html file in browser and run the game.

Documentation

See Reference Manual on Wiki.

Examples

This is Hello world Gaiman DSL example:

echo* "Hi, What is your name?", 50 # Typing animation with 50ms delay
let name = ask "name? "
echo "Hello $name, nice to meet you."

More advanced example:

def ask_email(message)
   let reply = ask message
   if reply =~ /y|yes/i then
      echo "OK"
   else if reply =~ /n|no/i then
      echo "FAIL"
   else
      global(message)
   end
end

def global(command)
   if command =~ /help/ then
      echo "available commands help"
   else if command =~ /ls/ then
      echo get "/exec?command=ls"
   else
      echo "wrong command"
   end
end

if cookie.visited then
  if cookie.USER_NAME then
    echo "hello $user"
  else if cookie.EMAIL then
    echo "Will contact with with any updates"
  else
    echo "Do you want me to contact you with updates?"
    let confirm = ask "yes/no: "
    if confirm =~ /y|yes/i then
      echo "what is your name?"
      let command = ask "name: "
      if command then
        let user = command
        cookie.user = command
        let response = post "/register", { "name" => user, "email" => email }
        if response then
          echo "Welcome $user. You're successfully registered"
        end
      end
    end
  end
end

More examples in examples directory See Reference Manual

Live Demo

See Gaiman language Playground

Gaiman programming language Playground Demo Session

Roadmap

See Wiki TODO & Roadmap.

Name and Origin

Name came from Neil Gaiman, Author of novels, comic books, graphic novels and films. Great storyteller.

You can read about the origin of the language in the beginning of the article:

Acknowledge

Logo use:

License

Released under GNU GPL v3 or later
Copyright (c) 2021 Jakub T. Jankiewicz

FAQs

Package last updated on 25 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc