-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make rng pass-through in ROT.Dice.roll explicit
Resolves an issue when calling ROT.Dice.roll from love2d
- Loading branch information
1 parent
418d72d
commit 1bf0989
Showing
75 changed files
with
388 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | ||
<head> | ||
<title>rotLove Reference</title> | ||
<link rel="stylesheet" href="../ldoc.css" type="text/css" /> | ||
</head> | ||
<body> | ||
|
||
<div id="container"> | ||
|
||
<div id="product"> | ||
<div id="product_logo"></div> | ||
<div id="product_name"><big><b></b></big></div> | ||
<div id="product_description"></div> | ||
</div> <!-- id="product" --> | ||
|
||
|
||
<div id="main"> | ||
|
||
|
||
<!-- Menu --> | ||
|
||
<div id="navigation"> | ||
<br/> | ||
<h1>rotLove</h1> | ||
|
||
<ul> | ||
<li><a href="../index.html">Index</a></li> | ||
</ul> | ||
|
||
|
||
|
||
<h2>Examples</h2> | ||
<ul class="nowrap"> | ||
<li><a href="../examples/action.lua.html">action.lua</a></li> | ||
<li><a href="../examples/arena.lua.html">arena.lua</a></li> | ||
<li><a href="../examples/astar.lua.html">astar.lua</a></li> | ||
<li><a href="../examples/bresenham.lua.html">bresenham.lua</a></li> | ||
<li><a href="../examples/brogue.lua.html">brogue.lua</a></li> | ||
<li><a href="../examples/broguecavegeneration.lua.html">broguecavegeneration.lua</a></li> | ||
<li><a href="../examples/cellular.lua.html">cellular.lua</a></li> | ||
<li><a href="../examples/characters.lua.html">characters.lua</a></li> | ||
<li><a href="../examples/color.lua.html">color.lua</a></li> | ||
<li><strong>dice.lua</strong></li> | ||
<li><a href="../examples/dice_advanced_uses.lua.html">dice_advanced_uses.lua</a></li> | ||
<li><a href="../examples/dice_basic.lua.html">dice_basic.lua</a></li> | ||
<li><a href="../examples/dice_boundry_behaviour.lua.html">dice_boundry_behaviour.lua</a></li> | ||
<li><a href="../examples/dice_metamethods.lua.html">dice_metamethods.lua</a></li> | ||
<li><a href="../examples/dice_minimum.lua.html">dice_minimum.lua</a></li> | ||
<li><a href="../examples/dice_valid_notation.lua.html">dice_valid_notation.lua</a></li> | ||
<li><a href="../examples/dice_weapon_samples.lua.html">dice_weapon_samples.lua</a></li> | ||
<li><a href="../examples/digger.lua.html">digger.lua</a></li> | ||
<li><a href="../examples/dijkstra.lua.html">dijkstra.lua</a></li> | ||
<li><a href="../examples/dijkstramap.lua.html">dijkstramap.lua</a></li> | ||
<li><a href="../examples/dividedmaze.lua.html">dividedmaze.lua</a></li> | ||
<li><a href="../examples/ellermaze.lua.html">ellermaze.lua</a></li> | ||
<li><a href="../examples/engine.lua.html">engine.lua</a></li> | ||
<li><a href="../examples/event.lua.html">event.lua</a></li> | ||
<li><a href="../examples/iceymaze.lua.html">iceymaze.lua</a></li> | ||
<li><a href="../examples/lighting.lua.html">lighting.lua</a></li> | ||
<li><a href="../examples/precise.lua.html">precise.lua</a></li> | ||
<li><a href="../examples/precisewithmovingplayer.lua.html">precisewithmovingplayer.lua</a></li> | ||
<li><a href="../examples/rng.lua.html">rng.lua</a></li> | ||
<li><a href="../examples/rogue.lua.html">rogue.lua</a></li> | ||
<li><a href="../examples/simple.lua.html">simple.lua</a></li> | ||
<li><a href="../examples/simplex.lua.html">simplex.lua</a></li> | ||
<li><a href="../examples/speed.lua.html">speed.lua</a></li> | ||
<li><a href="../examples/stringgen.lua.html">stringgen.lua</a></li> | ||
<li><a href="../examples/textdisplay.lua.html">textdisplay.lua</a></li> | ||
<li><a href="../examples/uniform.lua.html">uniform.lua</a></li> | ||
</ul> | ||
<h2>Modules</h2> | ||
<ul class="nowrap"> | ||
<li><a href="../modules/ROT.Scheduler.Action.html">ROT.Scheduler.Action</a></li> | ||
<li><a href="../modules/ROT.Map.Arena.html">ROT.Map.Arena</a></li> | ||
<li><a href="../modules/ROT.Path.AStar.html">ROT.Path.AStar</a></li> | ||
<li><a href="../modules/ROT.FOV.Bresenham.html">ROT.FOV.Bresenham</a></li> | ||
<li><a href="../modules/ROT.Map.Brogue.html">ROT.Map.Brogue</a></li> | ||
<li><a href="../modules/ROT.Map.BrogueRoom.html">ROT.Map.BrogueRoom</a></li> | ||
<li><a href="../modules/ROT.Map.Cellular.html">ROT.Map.Cellular</a></li> | ||
<li><a href="../modules/ROT.Color.html">ROT.Color</a></li> | ||
<li><a href="../modules/ROT.Map.Corridor.html">ROT.Map.Corridor</a></li> | ||
<li><a href="../modules/ROT.Dice.html">ROT.Dice</a></li> | ||
<li><a href="../modules/ROT.Map.Digger.html">ROT.Map.Digger</a></li> | ||
<li><a href="../modules/ROT.Path.Dijkstra.html">ROT.Path.Dijkstra</a></li> | ||
<li><a href="../modules/ROT.DijkstraMap.html">ROT.DijkstraMap</a></li> | ||
<li><a href="../modules/ROT.Display.html">ROT.Display</a></li> | ||
<li><a href="../modules/ROT.Map.DividedMaze.html">ROT.Map.DividedMaze</a></li> | ||
<li><a href="../modules/ROT.Map.Dungeon.html">ROT.Map.Dungeon</a></li> | ||
<li><a href="../modules/ROT.Map.EllerMaze.html">ROT.Map.EllerMaze</a></li> | ||
<li><a href="../modules/ROT.EventQueue.html">ROT.EventQueue</a></li> | ||
<li><a href="../modules/ROT.Map.IceyMaze.html">ROT.Map.IceyMaze</a></li> | ||
<li><a href="../modules/ROT.RNG.LCG.html">ROT.RNG.LCG</a></li> | ||
<li><a href="../modules/ROT.Lighting.html">ROT.Lighting</a></li> | ||
<li><a href="../modules/ROT.RNG.MWC.html">ROT.RNG.MWC</a></li> | ||
<li><a href="../modules/ROT.FOV.Precise.html">ROT.FOV.Precise</a></li> | ||
<li><a href="../modules/ROT.FOV.Recursive.html">ROT.FOV.Recursive</a></li> | ||
<li><a href="../modules/ROT.RNG.html">ROT.RNG</a></li> | ||
<li><a href="../modules/ROT.Map.Rogue.html">ROT.Map.Rogue</a></li> | ||
<li><a href="../modules/ROT.Map.Room.html">ROT.Map.Room</a></li> | ||
<li><a href="../modules/ROT.Scheduler.html">ROT.Scheduler</a></li> | ||
<li><a href="../modules/ROT.Scheduler.Simple.html">ROT.Scheduler.Simple</a></li> | ||
<li><a href="../modules/ROT.Noise.Simplex.html">ROT.Noise.Simplex</a></li> | ||
<li><a href="../modules/ROT.Scheduler.Speed.html">ROT.Scheduler.Speed</a></li> | ||
<li><a href="../modules/ROT.StringGenerator.html">ROT.StringGenerator</a></li> | ||
<li><a href="../modules/ROT.TextDisplay.html">ROT.TextDisplay</a></li> | ||
<li><a href="../modules/ROT.RNG.Twister.html">ROT.RNG.Twister</a></li> | ||
<li><a href="../modules/ROT.Map.Uniform.html">ROT.Map.Uniform</a></li> | ||
</ul> | ||
|
||
</div> | ||
|
||
<div id="content"> | ||
|
||
<h2>dice.lua</h2> | ||
<pre> | ||
ROT=<span class="global">require</span> <span class="string">'rotLove/rotLove'</span> | ||
<span class="keyword">local</span> f, d_with_rng, lcg | ||
<span class="keyword">function</span> love.<span class="global">load</span>() | ||
f=ROT.Display:new(<span class="number">80</span>,<span class="number">24</span>) | ||
lcg=ROT.RNG.LCG:new() | ||
lcg:randomseed() | ||
d_with_rng=ROT.Dice:new(<span class="string">'3d6'</span>, <span class="number">1</span>, lcg) | ||
d_without_rng=ROT.Dice:new(<span class="string">'3d6'</span>, <span class="number">1</span>) | ||
<span class="keyword">end</span> | ||
<span class="keyword">function</span> love.draw() f:draw() <span class="keyword">end</span> | ||
|
||
<span class="keyword">local</span> t=<span class="number">1.00000001</span> | ||
<span class="keyword">function</span> love.update(dt) | ||
<span class="keyword">if</span> t><span class="number">1</span> <span class="keyword">then</span> | ||
f:clear() | ||
f:writeCenter(<span class="string">"ROLL instance with rng: "</span>..d_with_rng:roll(), <span class="number">1</span>) | ||
f:writeCenter(<span class="string">"ROLL instance with rng: "</span>..d_with_rng:roll(), <span class="number">2</span>) | ||
f:writeCenter(<span class="string">"ROLL instance with rng: "</span>..d_with_rng:roll(), <span class="number">3</span>) | ||
f:writeCenter(<span class="string">"ROLL instance with rng: "</span>..d_with_rng:roll(), <span class="number">4</span>) | ||
|
||
f:writeCenter(<span class="string">"ROLL instance without rng: "</span>..d_without_rng:roll(), <span class="number">6</span>) | ||
f:writeCenter(<span class="string">"ROLL instance without rng: "</span>..d_without_rng:roll(), <span class="number">7</span>) | ||
f:writeCenter(<span class="string">"ROLL instance without rng: "</span>..d_without_rng:roll(), <span class="number">8</span>) | ||
f:writeCenter(<span class="string">"ROLL instance without rng: "</span>..d_without_rng:roll(), <span class="number">9</span>) | ||
|
||
f:writeCenter(<span class="string">"ROLL ROT.Dice with rng: "</span>..ROT.Dice.roll(<span class="string">'3d6'</span>, <span class="number">1</span>, lcg), <span class="number">11</span>) | ||
f:writeCenter(<span class="string">"ROLL ROT.Dice with rng: "</span>..ROT.Dice.roll(<span class="string">'3d6'</span>, <span class="number">1</span>, lcg), <span class="number">12</span>) | ||
f:writeCenter(<span class="string">"ROLL ROT.Dice with rng: "</span>..ROT.Dice.roll(<span class="string">'3d6'</span>, <span class="number">1</span>, lcg), <span class="number">13</span>) | ||
f:writeCenter(<span class="string">"ROLL ROT.Dice with rng: "</span>..ROT.Dice.roll(<span class="string">'3d6'</span>, <span class="number">1</span>, lcg), <span class="number">14</span>) | ||
|
||
f:writeCenter(<span class="string">"ROLL ROT.Dice without rng: "</span>..ROT.Dice.roll(<span class="string">'3d6'</span>, <span class="number">1</span>), <span class="number">16</span>) | ||
f:writeCenter(<span class="string">"ROLL ROT.Dice without rng: "</span>..ROT.Dice.roll(<span class="string">'3d6'</span>, <span class="number">1</span>), <span class="number">17</span>) | ||
f:writeCenter(<span class="string">"ROLL ROT.Dice without rng: "</span>..ROT.Dice.roll(<span class="string">'3d6'</span>, <span class="number">1</span>), <span class="number">18</span>) | ||
f:writeCenter(<span class="string">"ROLL ROT.Dice without rng: "</span>..ROT.Dice.roll(<span class="string">'3d6'</span>, <span class="number">1</span>), <span class="number">19</span>) | ||
|
||
f:writeCenter(<span class="string">"Rolling 3d6's"</span>, <span class="number">23</span>) | ||
t=<span class="number">0</span> | ||
<span class="keyword">end</span> | ||
t=t+dt | ||
<span class="keyword">end</span></pre> | ||
|
||
|
||
</div> <!-- id="content" --> | ||
</div> <!-- id="main" --> | ||
<div id="about"> | ||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> | ||
<i style="float:right;">Last updated 2017-02-21 14:09:30 </i> | ||
</div> <!-- id="about" --> | ||
</div> <!-- id="container" --> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.