Project

lomic

0.0
No commit activity in last 3 years
No release in over 3 years
Lomic is a Domain Specific Language (DSL) intended to be used for Pomic, a programming version of the game Nomic.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 4.0.3
>= 0.8.0
>= 1.4.3
 Project Readme

Lomic¶ ↑

Lomic is a Domain Specific Language (DSL) intended to be used for Pomic, a programming version of the game Nomic.

Getting Started¶ ↑

Installing¶ ↑

Install the gem:

$ gem install lomic

Or grab the latest code from github:

$ git clone git://github.com/mindeavor/lomic.git
$ cd lomic
$ rake install

Quick Example¶ ↑

Here’s a self-contained, offline example. For a networking example, check out listen_path.rb in the examples folder

simple.rb:

class Globals < Lomic
  var :didiwin => 'No...'
end

rule 101 do |g| # g refers to globals
  event "game:start" do
    puts '[Example: simple.rb]'
    g.didiwin = 'Yes!'
    set_next "game:test1"
  end

  event "game:test1" do
    puts "Did I win? #{g.didiwin}"
  end
end

myParseFile.rb:

require 'lomic'
game_state = Lomic.parse('simple.rb', 'game:start')

What does Lomic look like?¶ ↑

Lomic is designed to be expressive in declaring rules for the game Nomic:

class Globals < Lomic
  var :players => []
  var :currentPlayer
end

class Player < Lomic
  resource :hp => 15 # resources have a max and min value
end

rule 101 do |g| # g refers to globals
  ### The game begins with 4 players.
  ### Each player is assigned a unique number.
  event "game:start" do
    Player.new_var :number => 0
    4.times do |i|
      p = Player.new
      p.number = i
      g.players.push(p)
    end
  end
end

rule 102 do |g|
  ### At the beginning of each player's turn,
  ### that player takes 3 damage
  event "turn:start" do
    currentPlayer.hp -= 3
  end
end

Check out the ‘examples/` folder to see what Lomic is supposed to look like, and `parse.rb` to see how to use Lomic (in its current, underdeveloped state)

Contributing¶ ↑

Lomic is currently in the concept and development stage. To discuss contributing, syntax, goals, or implementation, join us at #lomic on irc.freenode, or email me at gilbertbgarza aT gmail

Copyright © 2010 Gilbert B Garza. See LICENSE for details.