Save 37% off PRO during our Black Friday Sale! »

Abuse Ruby - Not Your Friends - yeah

Abuse Ruby - Not Your Friends - yeah

The story of how I designed and iterated my board game Missiles & Microchips with ruby.

2f7eb8e439ce2d288dcfa240b5210664?s=128

Yonatan Bergman

March 30, 2014
Tweet

Transcript

  1. "#64&36#:
 /05:063'3*&/%4 !:0/#&3(."/ The story of Missiles&Microchips

  2. 5IF*EFB

  3. 5IF#BTJDT

  4. 5IF#BTJDT

  5. "EEJOH$PEF

  6. $  ruby  game.rb   ! Winner:  ["#Player  2"]  at  turn

     number  31
  7. $  ruby  game.rb  10  20   ! -­‐-­‐-­‐  TURN  1

     -­‐-­‐-­‐   #Player  1  (10)  defends   #Player  2  (10)  attacks  #Player  3  (10)   #Player  3  (9)  charges  (10)   …   -­‐-­‐-­‐  TURN  47  -­‐-­‐-­‐   #Player  1  (13)  defends   #Player  3  (19)  charges  (20)   ! Winners:  ["#Player  3"]  at  turn  number  47
  8. $  ruby  multigame.rb   ! Played  1000  games   Game

     ended  at  turn  24.821  averagely   Victory  count  by  players:     [["Player  1",  314],      ["Player  2",  354],      ["Player  3",  340]]
  9. $  ruby  multigame.rb   ! Played  1000  games  with  3

     players   Game  ended  at  turn  25.516  averagely   Games  mostly  ended  with  last_man_standing  (71.0)   Then  with  victory_points  (29.0)
  10. $  ruby  multigame.rb   ! Played  1000  games  with  3

     players   Game  ended  at  turn  25.082  averagely   Games  mostly  ended  with  last_man_standing  (60.7)   Then  with  victory_points  (39.3) $  ruby  multigame.rb   ! Played  1000  games  with  3  players   Game  ended  at  turn  25.082  averagely   Games  mostly  ended  with  last_man_standing  (60.7)   Then  with  victory_points  (39.3)
  11. $  ruby  runner.rb  multi   ! Played  10000  games  with

     3  players   Game  ended  at  turn  14.7317  averagely   Games  mostly  ended  with  a  LMS  (87.73%),     then  with  VP  (12.27%)   ! Victory  count  by  players:    Player::Basic  1   31.08%  (3108)    Player::Basic  2   32.93%  (3293)    Player::AI         36.13%  (3613)
  12. 2 1 5 4.0913 LMS 90.37% VP 9.63% 2 2

    5 6.0226 LMS 73.47% VP 26.53% 2 3 5 6.1922 LMS 50.30% VP 49.70% 2 4 5 4.0649 VP 77.52% LMS 22.48% 2 1 6 4.7287 LMS 93.21% VP 6.79% 2 2 6 7.4563 LMS 82.80% VP 17.20% 2 3 6 8.8977 LMS 66.31% VP 33.69% 2 4 6 8.2597 VP 53.56% LMS 46.44% 2 5 6 5.0287 VP 79.29% LMS 20.71% 2 1 7 5.0806 LMS 95.63% VP 4.37% 2 2 7 8.6032 LMS 87.94% VP 12.06% 2 3 7 11.1296 LMS 76.95% VP 23.05% 2 4 7 11.9691 LMS 61.34% VP 38.66% 2 5 7 10.266 VP 58.27% LMS 41.73% 2 6 7 5.9262 VP 80.90% LMS 19.10% 2 1 8 5.406 LMS 97.02% VP 2.98% 2 2 8 9.4609 LMS 91.88% VP 8.12% 2 3 8 12.9289 LMS 83.70% VP 16.30% 2 4 8 14.8757 LMS 72.81% VP 27.19% 2 5 8 15.0612 LMS 56.91% VP 43.09% 2 6 8 12.5056 VP 60.03% LMS 39.97%
  13. 2 1 5 4.0913 LMS 90.37% VP 9.63% 2 2

    5 6.0226 LMS 73.47% VP 26.53% 2 3 5 6.1922 LMS 50.30% VP 49.70% 2 4 5 4.0649 VP 77.52% LMS 22.48% 2 1 6 4.7287 LMS 93.21% VP 6.79% 2 2 6 7.4563 LMS 82.80% VP 17.20% 2 3 6 8.8977 LMS 66.31% VP 33.69% 2 4 6 8.2597 VP 53.56% LMS 46.44% 2 5 6 5.0287 VP 79.29% LMS 20.71% 2 1 7 5.0806 LMS 95.63% VP 4.37% 2 2 7 8.6032 LMS 87.94% VP 12.06% 2 3 7 11.1296 LMS 76.95% VP 23.05% 2 4 7 11.9691 LMS 61.34% VP 38.66% 2 5 7 10.266 VP 58.27% LMS 41.73% 2 6 7 5.9262 VP 80.90% LMS 19.10% 2 1 8 5.406 LMS 97.02% VP 2.98% 2 2 8 9.4609 LMS 91.88% VP 8.12% 2 3 8 12.9289 LMS 83.70% VP 16.30% 2 4 8 14.8757 LMS 72.81% VP 27.19% 2 5 8 15.0612 LMS 56.91% VP 43.09% 2 6 8 12.5056 VP 60.03% LMS 39.97% 0" 5" 10" 15" 20" 25" 30" 35" 1" 4" 7" 10" 13" 16" 19" 22" 25" 28" 31" 34" 37" 40" 43" 46" 49" 52" 55" 58" 61" 64" 67" 70" 73" 76" 79" 82" 85" 88" 91" 94" 97" 100"103"106"109"112"115"118"121"124"127"130"133"136"139"142"145"148"151"154"157"160"163"166"169"172"175"178"181"184"187"190"193"196"199"202"205"208"211"214"217"220"223"226"229"232" Series1" Series2" Series3" Series4" Series5"
  14. None
  15. None
  16. $  ruby  runner.rb  m   ! Played  5000  games  with

     4  players   Game  ended  at  turn  17.9706  averagely   Games  mostly  ended  with  a  LMS  (65.18%),      then  with  VP  (29.86%)   Games  ended  with  a  draw:  4.96%   Victory  count  by  players:    Player::Basic  1   23.68%  (1184)    Player::Basic  2   24.46%  (1223)    Player::Basic  3   24.02%  (1201)    Player::Basic  4   23.42%  (1171)
  17. $  ruby  runner.rb  multi   ! Played  10000  games  with

     3  players   Game  ended  at  turn  14.7317  averagely   Games  mostly  ended  with  a  LMS  (87.73%),     then  with  VP  (12.27%)   ! Victory  count  by  players:    Player::Basic  1   31.08%  (3108)    Player::Basic  2   32.93%  (3293)    Player::Basic  3   36.13%  (3613) 0" 5" 10" 15" 20" 25" 1" 4" 7" 10" 13" 16" 19" 22" 25" 28" 31" 34" 37" 40" 43" 46" 49" 52" 55" 58" 61" 64" 67" 70" 73" 76" 79" 82" 85" 88" 91" 94" 97"100"103"106"109"112"115"118"121"124"127"130"133"136"139"142"145"148"151"154"157"160"163"166"169"172"175"178"181"184"187"190"193"196"199" 202"205"208"211"214"217"220"223"226"229"232" Series1" Series2" Series3" Series4" Series5" 0" 5" 10" 15" 20" 25" 30" 35" 1" 4" 7" 10" 13" 16" 19" 22" 25" 28" 31" 34" 37" 40" 43" 46" 49" 52" 55" 58" 61" 64" 67" 70" 73" 76" 79" 82" 85" 88" 91" 94" 97" 100"103"106"109"112"115"118"121"124"127"130"133"136"139"142"145"148"151"154"157"160"163"166"169"172"175"178"181"184"187"190"193"196"199"202"205"208"211"214"217"220"223"226"229"232" Series1" Series2" Series3" Series4" Series5"
  18. 1SPUPUZQF

  19. 1SPUPUZQF

  20. 1SPUPUZQF

  21. 1SPUPUZQF

  22. l%FTJHOz

  23. None
  24. 1SPUPUZQF

  25. 1SPUPUZQF

  26. 1SPUPUZQF

  27. 1SPUPUZQF

  28. 1SPUPUZQF

  29. 1SPUPUZQF

  30. 1SPUPUZQF  

  31. >_

  32. $  ruby  runner.rb  powers   ! A      

      B          C         D          E   36.12%   27.39%  16.16%   13.60%      -­‐   31.35%   25.97%    12.14%      -­‐      24.72%   30.81%   25.56%        -­‐          10.81%    26.65%   36.97%     -­‐      14.23%  12.65%    29.18%      -­‐       28.31%    17.59%  14.93%    32.49%
  33. 5I'VVSF

  34. $  ruby  -­‐e  ‘puts  ENV[“GREETING”]’   ! Thank  you  

    >   ! ! ! ! ! ! ! ! _ !:0/#&3(."/