This-Game / monte-carlo-werewolf-simulation

How likely are the Villagers to defeat the Werewolves, in different configurations of players roles (more / fewer wolves, the Seer, the Healer etc.)
MIT License
41 stars 6 forks source link

Simulation not working #1

Open stared opened 10 years ago

stared commented 10 years ago

When I run $ ruby simulate.rb (from the master branch), after installing chance, I am getting:

simulate.rb:84:in `require_relative': /path/monte-carlo-werewolf-simulation/simulator.rb:49: invalid multibyte char (US-ASCII) (SyntaxError)
/path/monte-carlo-werewolf-simulation/simulator.rb:49: invalid multibyte char (US-ASCII)
/path/monte-carlo-werewolf-simulation/simulator.rb:49: syntax error, unexpected $end, expecting ')'
...|" + ("#" * share.to_i) +  ("–" * (100 - share).to_i) + "|...
...                               ^
    from simulate.rb:84:in `<main>'

(Everything what follows is hokus-pokus, as I am not much into Ruby.)

Changing "–" to "-" solves (or silences?) the problem, but still makes me unable to run the simulation. That is, after I type $ ruby simulate.rb I am getting help instructions:

Usage: simulate [OPTIONS]
...
A 9 person game with 5 villagers, two werewolves, a seer, and a healer:
 simulate -v 6 -w 2 -s 1 -h 1

However, setting parameters, e.g. typing:

$ ruby simulate.rb -v 3 -w 1

does not give any other output - I am getting the same help message.

tonyrobots commented 9 years ago

I have the same problem (not the 'invalid multibyte char' issue), but the subsequent one where it just shows help text no matter what you do. Setting the debug (-d) option seems to shake it out of that, and it works. Investigating this to help tune my online version of werewolf (still in early alpha!): http://wolfy.herokuapp.com/