rushcheck 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. data/Rakefile +1 -1
  2. data/data/rushcheck/doc/policy.txt +107 -0
  3. data/data/rushcheck/doc/rushcheck.thtml +832 -0
  4. data/data/rushcheck/examples/candy.rb +6 -8
  5. data/data/rushcheck/examples/printf.rb +3 -3
  6. data/data/rushcheck/examples/proc.rb +4 -4
  7. data/data/rushcheck/examples/roguetile.rb +16 -16
  8. data/data/rushcheck/examples/sample.rb +10 -10
  9. data/data/rushcheck/rdoc/classes/Arbitrary.html +5 -5
  10. data/data/rushcheck/rdoc/classes/Arbitrary.src/M000082.html +18 -0
  11. data/data/rushcheck/rdoc/classes/Assertion.html +11 -11
  12. data/data/rushcheck/rdoc/classes/Assertion.src/M000019.html +20 -0
  13. data/data/rushcheck/rdoc/classes/Assertion.src/M000020.html +50 -0
  14. data/data/rushcheck/rdoc/classes/Coarbitrary.html +5 -5
  15. data/data/rushcheck/rdoc/classes/Coarbitrary.src/M000105.html +18 -0
  16. data/data/rushcheck/rdoc/classes/FalseClass.html +15 -15
  17. data/data/rushcheck/rdoc/classes/FalseClass.src/M000022.html +18 -0
  18. data/data/rushcheck/rdoc/classes/FalseClass.src/M000023.html +18 -0
  19. data/data/rushcheck/rdoc/classes/FalseClass.src/M000024.html +18 -0
  20. data/data/rushcheck/rdoc/classes/Float.html +20 -20
  21. data/data/rushcheck/rdoc/classes/Float.src/M000052.html +21 -0
  22. data/data/rushcheck/rdoc/classes/Float.src/M000053.html +18 -0
  23. data/data/rushcheck/rdoc/classes/Float.src/M000054.html +22 -0
  24. data/data/rushcheck/rdoc/classes/Float.src/M000055.html +20 -0
  25. data/data/rushcheck/rdoc/classes/Gen.html +102 -102
  26. data/data/rushcheck/rdoc/classes/Gen.src/M000030.html +4 -10
  27. data/data/rushcheck/rdoc/classes/Gen.src/M000031.html +29 -4
  28. data/data/rushcheck/rdoc/classes/Gen.src/M000032.html +6 -4
  29. data/data/rushcheck/rdoc/classes/Gen.src/M000033.html +14 -4
  30. data/data/rushcheck/rdoc/classes/Gen.src/M000034.html +10 -4
  31. data/data/rushcheck/rdoc/classes/Gen.src/M000035.html +4 -4
  32. data/data/rushcheck/rdoc/classes/Gen.src/M000036.html +4 -10
  33. data/data/rushcheck/rdoc/classes/Gen.src/M000037.html +4 -4
  34. data/data/rushcheck/rdoc/classes/Gen.src/M000038.html +4 -7
  35. data/data/rushcheck/rdoc/classes/Gen.src/M000039.html +4 -4
  36. data/data/rushcheck/rdoc/classes/Gen.src/M000040.html +10 -4
  37. data/data/rushcheck/rdoc/classes/Gen.src/M000041.html +4 -9
  38. data/data/rushcheck/rdoc/classes/Gen.src/M000042.html +7 -5
  39. data/data/rushcheck/rdoc/classes/Gen.src/M000043.html +4 -4
  40. data/data/rushcheck/rdoc/classes/Gen.src/M000044.html +4 -10
  41. data/data/rushcheck/rdoc/classes/Gen.src/M000045.html +23 -0
  42. data/data/rushcheck/rdoc/classes/Gen.src/M000046.html +19 -0
  43. data/data/rushcheck/rdoc/classes/Gen.src/M000047.html +18 -0
  44. data/data/rushcheck/rdoc/classes/Gen.src/M000048.html +24 -0
  45. data/data/rushcheck/rdoc/classes/Guard.html +10 -10
  46. data/data/rushcheck/rdoc/classes/Guard.src/M000028.html +27 -0
  47. data/data/rushcheck/rdoc/classes/Guard.src/M000029.html +18 -0
  48. data/data/rushcheck/rdoc/classes/HsRandom.html +20 -20
  49. data/data/rushcheck/rdoc/classes/HsRandom.src/M000088.html +22 -0
  50. data/data/rushcheck/rdoc/classes/HsRandom.src/M000089.html +32 -0
  51. data/data/rushcheck/rdoc/classes/HsRandom.src/M000090.html +18 -0
  52. data/data/rushcheck/rdoc/classes/Integer.html +20 -20
  53. data/data/rushcheck/rdoc/classes/Integer.src/M000010.html +18 -0
  54. data/data/rushcheck/rdoc/classes/Integer.src/M000011.html +18 -0
  55. data/data/rushcheck/rdoc/classes/Integer.src/M000012.html +21 -0
  56. data/data/rushcheck/rdoc/classes/Integer.src/M000013.html +19 -0
  57. data/data/rushcheck/rdoc/classes/NilClass.html +15 -15
  58. data/data/rushcheck/rdoc/classes/NilClass.src/M000064.html +18 -0
  59. data/data/rushcheck/rdoc/classes/NilClass.src/M000065.html +18 -0
  60. data/data/rushcheck/rdoc/classes/NilClass.src/M000066.html +18 -0
  61. data/data/rushcheck/rdoc/classes/Property.html +10 -10
  62. data/data/rushcheck/rdoc/classes/Property.src/M000077.html +26 -0
  63. data/data/rushcheck/rdoc/classes/Property.src/M000078.html +18 -0
  64. data/data/rushcheck/rdoc/classes/RandomArray.html +15 -15
  65. data/data/rushcheck/rdoc/classes/RandomArray.src/M000025.html +18 -0
  66. data/data/rushcheck/rdoc/classes/RandomArray.src/M000026.html +35 -0
  67. data/data/rushcheck/rdoc/classes/RandomArray.src/M000027.html +22 -0
  68. data/data/rushcheck/rdoc/classes/RandomBool.html +10 -10
  69. data/data/rushcheck/rdoc/classes/RandomBool.src/M000086.html +18 -0
  70. data/data/rushcheck/rdoc/classes/RandomBool.src/M000087.html +19 -0
  71. data/data/rushcheck/rdoc/classes/RandomGen.html +20 -20
  72. data/data/rushcheck/rdoc/classes/RandomGen.src/M000083.html +18 -0
  73. data/data/rushcheck/rdoc/classes/RandomGen.src/M000084.html +18 -0
  74. data/data/rushcheck/rdoc/classes/RandomGen.src/M000085.html +18 -0
  75. data/data/rushcheck/rdoc/classes/RandomHash.html +16 -16
  76. data/data/rushcheck/rdoc/classes/RandomHash.src/M000049.html +18 -0
  77. data/data/rushcheck/rdoc/classes/RandomHash.src/M000050.html +26 -0
  78. data/data/rushcheck/rdoc/classes/RandomHash.src/M000051.html +22 -0
  79. data/data/rushcheck/rdoc/classes/RandomProc.html +20 -20
  80. data/data/rushcheck/rdoc/classes/RandomProc.src/M000060.html +18 -0
  81. data/data/rushcheck/rdoc/classes/RandomProc.src/M000061.html +30 -0
  82. data/data/rushcheck/rdoc/classes/RandomProc.src/M000062.html +26 -0
  83. data/data/rushcheck/rdoc/classes/RandomProc.src/M000063.html +20 -0
  84. data/data/rushcheck/rdoc/classes/Result.html +19 -19
  85. data/data/rushcheck/rdoc/classes/Result.src/M000056.html +18 -0
  86. data/data/rushcheck/rdoc/classes/Result.src/M000057.html +18 -0
  87. data/data/rushcheck/rdoc/classes/Result.src/M000058.html +18 -0
  88. data/data/rushcheck/rdoc/classes/RushCheckConfig.html +41 -11
  89. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000001.html +1 -1
  90. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000002.html +1 -1
  91. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000003.html +8 -4
  92. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000004.html +4 -24
  93. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000005.html +22 -39
  94. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000006.html +55 -0
  95. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000007.html +50 -0
  96. data/data/rushcheck/rdoc/classes/SpecialString.html +5 -5
  97. data/data/rushcheck/rdoc/classes/SpecialString.src/M000021.html +37 -0
  98. data/data/rushcheck/rdoc/classes/StdGen.html +27 -27
  99. data/data/rushcheck/rdoc/classes/StdGen.src/M000014.html +9 -4
  100. data/data/rushcheck/rdoc/classes/StdGen.src/M000015.html +21 -0
  101. data/data/rushcheck/rdoc/classes/StdGen.src/M000016.html +21 -0
  102. data/data/rushcheck/rdoc/classes/StdGen.src/M000017.html +18 -0
  103. data/data/rushcheck/rdoc/classes/StdGen.src/M000018.html +18 -0
  104. data/data/rushcheck/rdoc/classes/String.html +20 -20
  105. data/data/rushcheck/rdoc/classes/String.src/M000073.html +24 -0
  106. data/data/rushcheck/rdoc/classes/String.src/M000074.html +18 -0
  107. data/data/rushcheck/rdoc/classes/String.src/M000075.html +25 -0
  108. data/data/rushcheck/rdoc/classes/String.src/M000076.html +22 -0
  109. data/data/rushcheck/rdoc/classes/TestExausted.html +113 -0
  110. data/data/rushcheck/rdoc/classes/TestFailed.html +155 -0
  111. data/data/rushcheck/rdoc/classes/TestFailed.src/M000067.html +18 -0
  112. data/data/rushcheck/rdoc/classes/TestOk.html +113 -0
  113. data/data/rushcheck/rdoc/classes/TestOptions.html +180 -0
  114. data/data/rushcheck/rdoc/classes/TestOptions.src/M000008.html +18 -0
  115. data/data/rushcheck/rdoc/classes/TestOptions.src/M000009.html +18 -0
  116. data/data/rushcheck/rdoc/classes/TestResult.html +164 -0
  117. data/data/rushcheck/rdoc/classes/TestResult.src/M000068.html +18 -0
  118. data/data/rushcheck/rdoc/classes/Testable.html +96 -51
  119. data/data/rushcheck/rdoc/classes/Testable.src/M000091.html +4 -4
  120. data/data/rushcheck/rdoc/classes/Testable.src/M000092.html +4 -4
  121. data/data/rushcheck/rdoc/classes/Testable.src/M000095.html +4 -4
  122. data/data/rushcheck/rdoc/classes/Testable.src/M000096.html +18 -0
  123. data/data/rushcheck/rdoc/classes/Testable.src/M000097.html +18 -0
  124. data/data/rushcheck/rdoc/classes/Testable.src/M000099.html +19 -0
  125. data/data/rushcheck/rdoc/classes/Testable.src/M000100.html +21 -0
  126. data/data/rushcheck/rdoc/classes/Testable.src/M000101.html +18 -0
  127. data/data/rushcheck/rdoc/classes/Testable.src/M000103.html +18 -0
  128. data/data/rushcheck/rdoc/classes/Testable.src/M000104.html +18 -0
  129. data/data/rushcheck/rdoc/classes/TheStdGen.html +20 -20
  130. data/data/rushcheck/rdoc/classes/TheStdGen.src/M000069.html +18 -0
  131. data/data/rushcheck/rdoc/classes/TheStdGen.src/M000070.html +20 -0
  132. data/data/rushcheck/rdoc/classes/TheStdGen.src/M000071.html +21 -0
  133. data/data/rushcheck/rdoc/classes/TheStdGen.src/M000072.html +18 -0
  134. data/data/rushcheck/rdoc/classes/TrueClass.html +15 -15
  135. data/data/rushcheck/rdoc/classes/TrueClass.src/M000079.html +18 -0
  136. data/data/rushcheck/rdoc/classes/TrueClass.src/M000080.html +18 -0
  137. data/data/rushcheck/rdoc/classes/TrueClass.src/M000081.html +18 -0
  138. data/data/rushcheck/rdoc/created.rid +1 -1
  139. data/data/rushcheck/rdoc/files/rushcheck/config_rb.html +8 -1
  140. data/data/rushcheck/rdoc/files/rushcheck/testable_rb.html +3 -1
  141. data/data/rushcheck/rdoc/files/rushcheck/testoptions_rb.html +109 -0
  142. data/data/rushcheck/rdoc/files/rushcheck/testresult_rb.html +105 -0
  143. data/data/rushcheck/rdoc/files/rushcheck_rb.html +127 -0
  144. data/data/rushcheck/rdoc/fr_class_index.html +5 -0
  145. data/data/rushcheck/rdoc/fr_file_index.html +3 -1
  146. data/data/rushcheck/rdoc/fr_method_index.html +103 -94
  147. data/lib/rushcheck/arbitrary.rb +16 -12
  148. data/lib/rushcheck/array.rb +7 -6
  149. data/lib/rushcheck/assertion.rb +53 -50
  150. data/lib/rushcheck/bool.rb +26 -24
  151. data/lib/rushcheck/config.rb +131 -81
  152. data/lib/rushcheck/float.rb +4 -4
  153. data/lib/rushcheck/gen.rb +194 -182
  154. data/lib/rushcheck/guard.rb +9 -10
  155. data/lib/rushcheck/hash.rb +4 -3
  156. data/lib/rushcheck/integer.rb +11 -6
  157. data/lib/rushcheck/proc.rb +7 -7
  158. data/lib/rushcheck/property.rb +19 -15
  159. data/lib/rushcheck/random.rb +162 -159
  160. data/lib/rushcheck/result.rb +16 -12
  161. data/lib/rushcheck/string.rb +12 -12
  162. data/lib/rushcheck/testable.rb +99 -25
  163. data/lib/rushcheck/testoptions.rb +20 -0
  164. data/lib/rushcheck/testresult.rb +25 -0
  165. data/lib/{rushcheck/rushcheck.rb → rushcheck.rb} +2 -1
  166. metadata +93 -4
  167. data/data/rushcheck/doc/rushcheck.txt +0 -670
@@ -0,0 +1,50 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>test_batch (RushCheckConfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/config.rb, line 108</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_batch</span>(<span class="ruby-identifier">gen</span>, <span class="ruby-identifier">rnd</span>, <span class="ruby-identifier">nt</span>=<span class="ruby-value">1</span>, <span class="ruby-identifier">nf</span>=<span class="ruby-value">0</span>, <span class="ruby-identifier">stamps</span>=[])
15
+ <span class="ruby-identifier">ntest</span>, <span class="ruby-identifier">nfail</span> = <span class="ruby-identifier">nt</span>, <span class="ruby-identifier">nf</span>
16
+ <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
17
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ntest</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">max_test</span>
18
+ <span class="ruby-identifier">tests_result</span> = <span class="ruby-constant">TestOk</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;OK, passed&quot;</span>, <span class="ruby-identifier">ntest</span>, <span class="ruby-identifier">stamps</span>)
19
+ <span class="ruby-keyword kw">break</span>
20
+ <span class="ruby-keyword kw">end</span>
21
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">nfail</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">max_fail</span>
22
+ <span class="ruby-identifier">test_result</span> = <span class="ruby-constant">TestExausted</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'Arguments exhausted after '</span>, <span class="ruby-identifier">ntest</span>, <span class="ruby-identifier">stamps</span>)
23
+ <span class="ruby-keyword kw">break</span>
24
+ <span class="ruby-keyword kw">end</span>
25
+
26
+ <span class="ruby-identifier">rnd_l</span>, <span class="ruby-identifier">rnd_r</span> = <span class="ruby-identifier">rnd</span>.<span class="ruby-identifier">split</span>
27
+ <span class="ruby-identifier">result</span> = <span class="ruby-identifier">gen</span>.<span class="ruby-identifier">generate</span>(<span class="ruby-identifier">size</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">ntest</span>), <span class="ruby-identifier">rnd_r</span>)
28
+ <span class="ruby-identifier">message</span> = <span class="ruby-identifier">every</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">ntest</span>, <span class="ruby-identifier">result</span>.<span class="ruby-identifier">arguments</span>)
29
+ <span class="ruby-identifier">print</span> <span class="ruby-identifier">message</span> <span class="ruby-comment cmt"># don't puts</span>
30
+
31
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">ok</span>
32
+ <span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">nil</span>
33
+ <span class="ruby-identifier">nfail</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
34
+ <span class="ruby-keyword kw">redo</span>
35
+ <span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">true</span>
36
+ <span class="ruby-identifier">stamps</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">result</span>.<span class="ruby-identifier">stamp</span>)
37
+ <span class="ruby-identifier">ntest</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
38
+ <span class="ruby-keyword kw">redo</span>
39
+ <span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">false</span>
40
+ <span class="ruby-identifier">tests_result</span> = <span class="ruby-constant">TestFailed</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">result</span>.<span class="ruby-identifier">arguments</span>, <span class="ruby-identifier">ntest</span>)
41
+ <span class="ruby-keyword kw">break</span>
42
+ <span class="ruby-keyword kw">else</span>
43
+ <span class="ruby-identifier">raise</span>(<span class="ruby-constant">RuntimeError</span>, <span class="ruby-value str">&quot;RushCheck: illegal result&quot;</span>)
44
+ <span class="ruby-keyword kw">end</span>
45
+ <span class="ruby-keyword kw">end</span>
46
+
47
+ <span class="ruby-identifier">test_result</span>
48
+ <span class="ruby-keyword kw">end</span></pre>
49
+ </body>
50
+ </html>
@@ -100,7 +100,7 @@ href="String.html">String</a>.
100
100
  <h3 class="section-bar">Methods</h3>
101
101
 
102
102
  <div class="name-list">
103
- <a href="#M000017">arbitrary</a>&nbsp;&nbsp;
103
+ <a href="#M000021">arbitrary</a>&nbsp;&nbsp;
104
104
  </div>
105
105
  </div>
106
106
 
@@ -122,12 +122,12 @@ href="String.html">String</a>.
122
122
  <div id="methods">
123
123
  <h3 class="section-bar">Public Class methods</h3>
124
124
 
125
- <div id="method-M000017" class="method-detail">
126
- <a name="M000017"></a>
125
+ <div id="method-M000021" class="method-detail">
126
+ <a name="M000021"></a>
127
127
 
128
128
  <div class="method-heading">
129
- <a href="SpecialString.src/M000017.html" target="Code" class="method-signature"
130
- onclick="popupCode('SpecialString.src/M000017.html');return false;">
129
+ <a href="SpecialString.src/M000021.html" target="Code" class="method-signature"
130
+ onclick="popupCode('SpecialString.src/M000021.html');return false;">
131
131
  <span class="method-name">arbitrary</span><span class="method-args">()</span>
132
132
  </a>
133
133
  </div>
@@ -0,0 +1,37 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>arbitrary (SpecialString)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/string.rb, line 77</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">arbitrary</span>
15
+ <span class="ruby-identifier">f</span> = <span class="ruby-ivar">@@frequency</span>
16
+ <span class="ruby-identifier">frq</span> = []
17
+ [<span class="ruby-identifier">f</span>[<span class="ruby-value str">'alphabet'</span>],<span class="ruby-identifier">f</span>[<span class="ruby-value str">'control'</span>],<span class="ruby-identifier">f</span>[<span class="ruby-value str">'number'</span>],<span class="ruby-identifier">f</span>[<span class="ruby-value str">'special'</span>]].<span class="ruby-identifier">zip</span>(
18
+ [ <span class="ruby-ivar">@@alphabet</span>, <span class="ruby-ivar">@@control</span>, <span class="ruby-ivar">@@number</span>, <span class="ruby-ivar">@@special</span>]) <span class="ruby-keyword kw">do</span>
19
+ <span class="ruby-operator">|</span><span class="ruby-identifier">weight</span>, <span class="ruby-identifier">table</span><span class="ruby-operator">|</span>
20
+ <span class="ruby-identifier">gen</span> = <span class="ruby-constant">Gen</span>.<span class="ruby-identifier">oneof</span>(<span class="ruby-identifier">table</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-constant">Gen</span>.<span class="ruby-identifier">unit</span>(<span class="ruby-identifier">n</span>.<span class="ruby-identifier">chr</span>)})
21
+ <span class="ruby-identifier">frq</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">weight</span>, <span class="ruby-identifier">gen</span>]
22
+ <span class="ruby-keyword kw">end</span>
23
+
24
+ <span class="ruby-constant">Gen</span>.<span class="ruby-identifier">sized</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
25
+ <span class="ruby-constant">Gen</span>.<span class="ruby-identifier">choose</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">m</span>).<span class="ruby-identifier">bind</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">len</span><span class="ruby-operator">|</span>
26
+ <span class="ruby-constant">Gen</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
27
+ <span class="ruby-identifier">r2</span> = <span class="ruby-identifier">r</span>
28
+ (<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-identifier">len</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span>
29
+ <span class="ruby-identifier">r1</span>, <span class="ruby-identifier">r2</span> = <span class="ruby-identifier">r2</span>.<span class="ruby-identifier">split</span>
30
+ <span class="ruby-constant">Gen</span>.<span class="ruby-identifier">frequency</span>(<span class="ruby-identifier">frq</span>).<span class="ruby-identifier">value</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">r1</span>)
31
+ <span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">join</span>
32
+ <span class="ruby-keyword kw">end</span>
33
+ <span class="ruby-keyword kw">end</span>
34
+ <span class="ruby-keyword kw">end</span>
35
+ <span class="ruby-keyword kw">end</span></pre>
36
+ </body>
37
+ </html>
@@ -94,11 +94,11 @@ functional random number generator.
94
94
  <h3 class="section-bar">Methods</h3>
95
95
 
96
96
  <div class="name-list">
97
- <a href="#M000011">gen_next</a>&nbsp;&nbsp;
98
- <a href="#M000013">gen_range</a>&nbsp;&nbsp;
99
- <a href="#M000010">new</a>&nbsp;&nbsp;
100
- <a href="#M000012">split</a>&nbsp;&nbsp;
101
- <a href="#M000014">to_s</a>&nbsp;&nbsp;
97
+ <a href="#M000015">gen_next</a>&nbsp;&nbsp;
98
+ <a href="#M000017">gen_range</a>&nbsp;&nbsp;
99
+ <a href="#M000014">new</a>&nbsp;&nbsp;
100
+ <a href="#M000016">split</a>&nbsp;&nbsp;
101
+ <a href="#M000018">to_s</a>&nbsp;&nbsp;
102
102
  </div>
103
103
  </div>
104
104
 
@@ -151,12 +151,12 @@ left and right are two seeds of random number generator.
151
151
  <div id="methods">
152
152
  <h3 class="section-bar">Public Class methods</h3>
153
153
 
154
- <div id="method-M000010" class="method-detail">
155
- <a name="M000010"></a>
154
+ <div id="method-M000014" class="method-detail">
155
+ <a name="M000014"></a>
156
156
 
157
157
  <div class="method-heading">
158
- <a href="StdGen.src/M000010.html" target="Code" class="method-signature"
159
- onclick="popupCode('StdGen.src/M000010.html');return false;">
158
+ <a href="StdGen.src/M000014.html" target="Code" class="method-signature"
159
+ onclick="popupCode('StdGen.src/M000014.html');return false;">
160
160
  <span class="method-name">new</span><span class="method-args">(left=nil, right=nil)</span>
161
161
  </a>
162
162
  </div>
@@ -167,19 +167,19 @@ left and right are two seeds of random number generator.
167
167
 
168
168
  <h3 class="section-bar">Public Instance methods</h3>
169
169
 
170
- <div id="method-M000011" class="method-detail">
171
- <a name="M000011"></a>
170
+ <div id="method-M000015" class="method-detail">
171
+ <a name="M000015"></a>
172
172
 
173
173
  <div class="method-heading">
174
- <a href="StdGen.src/M000011.html" target="Code" class="method-signature"
175
- onclick="popupCode('StdGen.src/M000011.html');return false;">
174
+ <a href="StdGen.src/M000015.html" target="Code" class="method-signature"
175
+ onclick="popupCode('StdGen.src/M000015.html');return false;">
176
176
  <span class="method-name">gen_next</span><span class="method-args">()</span>
177
177
  </a>
178
178
  </div>
179
179
 
180
180
  <div class="method-description">
181
181
  <p>
182
- <a href="StdGen.html#M000011">gen_next</a> returns an array with length 2.
182
+ <a href="StdGen.html#M000015">gen_next</a> returns an array with length 2.
183
183
  The first component of result is a random integer. The last component is a
184
184
  new <a href="StdGen.html">StdGen</a> object as a new random number
185
185
  generator. See also <a href="RandomGen.html">RandomGen</a>.
@@ -187,30 +187,30 @@ generator. See also <a href="RandomGen.html">RandomGen</a>.
187
187
  </div>
188
188
  </div>
189
189
 
190
- <div id="method-M000013" class="method-detail">
191
- <a name="M000013"></a>
190
+ <div id="method-M000017" class="method-detail">
191
+ <a name="M000017"></a>
192
192
 
193
193
  <div class="method-heading">
194
- <a href="StdGen.src/M000013.html" target="Code" class="method-signature"
195
- onclick="popupCode('StdGen.src/M000013.html');return false;">
194
+ <a href="StdGen.src/M000017.html" target="Code" class="method-signature"
195
+ onclick="popupCode('StdGen.src/M000017.html');return false;">
196
196
  <span class="method-name">gen_range</span><span class="method-args">()</span>
197
197
  </a>
198
198
  </div>
199
199
 
200
200
  <div class="method-description">
201
201
  <p>
202
- <a href="StdGen.html#M000013">gen_range</a> returns an array with length 2
202
+ <a href="StdGen.html#M000017">gen_range</a> returns an array with length 2
203
203
  which represents a bound of generated random numbers.
204
204
  </p>
205
205
  </div>
206
206
  </div>
207
207
 
208
- <div id="method-M000012" class="method-detail">
209
- <a name="M000012"></a>
208
+ <div id="method-M000016" class="method-detail">
209
+ <a name="M000016"></a>
210
210
 
211
211
  <div class="method-heading">
212
- <a href="StdGen.src/M000012.html" target="Code" class="method-signature"
213
- onclick="popupCode('StdGen.src/M000012.html');return false;">
212
+ <a href="StdGen.src/M000016.html" target="Code" class="method-signature"
213
+ onclick="popupCode('StdGen.src/M000016.html');return false;">
214
214
  <span class="method-name">split</span><span class="method-args">()</span>
215
215
  </a>
216
216
  </div>
@@ -223,12 +223,12 @@ href="StdGen.html">StdGen</a> objects as two new random number generators.
223
223
  </div>
224
224
  </div>
225
225
 
226
- <div id="method-M000014" class="method-detail">
227
- <a name="M000014"></a>
226
+ <div id="method-M000018" class="method-detail">
227
+ <a name="M000018"></a>
228
228
 
229
229
  <div class="method-heading">
230
- <a href="StdGen.src/M000014.html" target="Code" class="method-signature"
231
- onclick="popupCode('StdGen.src/M000014.html');return false;">
230
+ <a href="StdGen.src/M000018.html" target="Code" class="method-signature"
231
+ onclick="popupCode('StdGen.src/M000018.html');return false;">
232
232
  <span class="method-name">to_s</span><span class="method-args">()</span>
233
233
  </a>
234
234
  </div>
@@ -5,14 +5,19 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>to_s (StdGen)</title>
8
+ <title>new (StdGen)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File rushcheck/random.rb, line 102</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
15
- <span class="ruby-ivar">@left</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">' '</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@right</span>.<span class="ruby-identifier">to_s</span>
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/random.rb, line 68</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">left</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">right</span>=<span class="ruby-keyword kw">nil</span>)
15
+ <span class="ruby-ivar">@left</span>, <span class="ruby-ivar">@right</span> = [<span class="ruby-identifier">left</span>, <span class="ruby-identifier">right</span>].<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span>
16
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">nil?</span>
17
+ <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">random</span>
18
+ <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">in_range</span>(<span class="ruby-identifier">x</span>)
19
+ <span class="ruby-keyword kw">end</span>
20
+ <span class="ruby-keyword kw">end</span>
16
21
  <span class="ruby-keyword kw">end</span></pre>
17
22
  </body>
18
23
  </html>
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>gen_next (StdGen)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/random.rb, line 80</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">gen_next</span>
15
+ <span class="ruby-identifier">s</span>, <span class="ruby-identifier">t</span> = [<span class="ruby-ivar">@left</span>, <span class="ruby-ivar">@right</span>].<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">random</span>(<span class="ruby-identifier">x</span>) }
16
+ <span class="ruby-identifier">z</span> = ((<span class="ruby-identifier">s</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">t</span>) <span class="ruby-operator">%</span> (<span class="ruby-ivar">@@max_bound</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@@min_bound</span>)) <span class="ruby-operator">+</span> <span class="ruby-ivar">@@min_bound</span>
17
+
18
+ [<span class="ruby-identifier">z</span>, <span class="ruby-constant">StdGen</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">t</span>)]
19
+ <span class="ruby-keyword kw">end</span></pre>
20
+ </body>
21
+ </html>
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>split (StdGen)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/random.rb, line 89</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">split</span>
15
+ <span class="ruby-identifier">g</span> = <span class="ruby-identifier">gen_next</span>[<span class="ruby-value">1</span>]
16
+ <span class="ruby-identifier">s</span>, <span class="ruby-identifier">t</span> = <span class="ruby-identifier">g</span>.<span class="ruby-identifier">left</span>, <span class="ruby-identifier">g</span>.<span class="ruby-identifier">right</span>
17
+
18
+ [<span class="ruby-constant">StdGen</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">s</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>, <span class="ruby-identifier">t</span>), <span class="ruby-constant">StdGen</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">t</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)]
19
+ <span class="ruby-keyword kw">end</span></pre>
20
+ </body>
21
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>gen_range (StdGen)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/random.rb, line 98</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">gen_range</span>
15
+ [<span class="ruby-ivar">@@min_bound</span>, <span class="ruby-ivar">@@max_bound</span>]
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>to_s (StdGen)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/random.rb, line 102</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
15
+ <span class="ruby-ivar">@left</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">' '</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@right</span>.<span class="ruby-identifier">to_s</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -86,10 +86,10 @@
86
86
  <h3 class="section-bar">Methods</h3>
87
87
 
88
88
  <div class="name-list">
89
- <a href="#M000067">arbitrary</a>&nbsp;&nbsp;
90
- <a href="#M000068">bound</a>&nbsp;&nbsp;
91
- <a href="#M000070">coarbitrary</a>&nbsp;&nbsp;
92
- <a href="#M000069">random_range</a>&nbsp;&nbsp;
89
+ <a href="#M000073">arbitrary</a>&nbsp;&nbsp;
90
+ <a href="#M000074">bound</a>&nbsp;&nbsp;
91
+ <a href="#M000076">coarbitrary</a>&nbsp;&nbsp;
92
+ <a href="#M000075">random_range</a>&nbsp;&nbsp;
93
93
  </div>
94
94
  </div>
95
95
 
@@ -118,12 +118,12 @@
118
118
  <div id="methods">
119
119
  <h3 class="section-bar">Public Class methods</h3>
120
120
 
121
- <div id="method-M000067" class="method-detail">
122
- <a name="M000067"></a>
121
+ <div id="method-M000073" class="method-detail">
122
+ <a name="M000073"></a>
123
123
 
124
124
  <div class="method-heading">
125
- <a href="String.src/M000067.html" target="Code" class="method-signature"
126
- onclick="popupCode('String.src/M000067.html');return false;">
125
+ <a href="String.src/M000073.html" target="Code" class="method-signature"
126
+ onclick="popupCode('String.src/M000073.html');return false;">
127
127
  <span class="method-name">arbitrary</span><span class="method-args">()</span>
128
128
  </a>
129
129
  </div>
@@ -132,12 +132,12 @@
132
132
  </div>
133
133
  </div>
134
134
 
135
- <div id="method-M000068" class="method-detail">
136
- <a name="M000068"></a>
135
+ <div id="method-M000074" class="method-detail">
136
+ <a name="M000074"></a>
137
137
 
138
138
  <div class="method-heading">
139
- <a href="String.src/M000068.html" target="Code" class="method-signature"
140
- onclick="popupCode('String.src/M000068.html');return false;">
139
+ <a href="String.src/M000074.html" target="Code" class="method-signature"
140
+ onclick="popupCode('String.src/M000074.html');return false;">
141
141
  <span class="method-name">bound</span><span class="method-args">()</span>
142
142
  </a>
143
143
  </div>
@@ -146,12 +146,12 @@
146
146
  </div>
147
147
  </div>
148
148
 
149
- <div id="method-M000069" class="method-detail">
150
- <a name="M000069"></a>
149
+ <div id="method-M000075" class="method-detail">
150
+ <a name="M000075"></a>
151
151
 
152
152
  <div class="method-heading">
153
- <a href="String.src/M000069.html" target="Code" class="method-signature"
154
- onclick="popupCode('String.src/M000069.html');return false;">
153
+ <a href="String.src/M000075.html" target="Code" class="method-signature"
154
+ onclick="popupCode('String.src/M000075.html');return false;">
155
155
  <span class="method-name">random_range</span><span class="method-args">(gen, lo=@@min_range, hi=@@max_range)</span>
156
156
  </a>
157
157
  </div>
@@ -162,12 +162,12 @@
162
162
 
163
163
  <h3 class="section-bar">Public Instance methods</h3>
164
164
 
165
- <div id="method-M000070" class="method-detail">
166
- <a name="M000070"></a>
165
+ <div id="method-M000076" class="method-detail">
166
+ <a name="M000076"></a>
167
167
 
168
168
  <div class="method-heading">
169
- <a href="String.src/M000070.html" target="Code" class="method-signature"
170
- onclick="popupCode('String.src/M000070.html');return false;">
169
+ <a href="String.src/M000076.html" target="Code" class="method-signature"
170
+ onclick="popupCode('String.src/M000076.html');return false;">
171
171
  <span class="method-name">coarbitrary</span><span class="method-args">(g)</span>
172
172
  </a>
173
173
  </div>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>arbitrary (String)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/string.rb, line 20</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">arbitrary</span>
15
+ <span class="ruby-constant">Gen</span>.<span class="ruby-identifier">sized</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span>
16
+ <span class="ruby-constant">Gen</span>.<span class="ruby-identifier">choose</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">n</span>).<span class="ruby-identifier">bind</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">len</span><span class="ruby-operator">|</span>
17
+ <span class="ruby-constant">Gen</span>.<span class="ruby-identifier">vector</span>(<span class="ruby-constant">Integer</span>, <span class="ruby-identifier">len</span>).<span class="ruby-identifier">bind</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">xs</span><span class="ruby-operator">|</span>
18
+ <span class="ruby-constant">Gen</span>.<span class="ruby-identifier">unit</span>(<span class="ruby-identifier">xs</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> (<span class="ruby-identifier">x</span> <span class="ruby-operator">%</span> <span class="ruby-value">128</span>).<span class="ruby-identifier">chr</span>}.<span class="ruby-identifier">join</span>)
19
+ <span class="ruby-keyword kw">end</span>
20
+ <span class="ruby-keyword kw">end</span>
21
+ <span class="ruby-keyword kw">end</span>
22
+ <span class="ruby-keyword kw">end</span></pre>
23
+ </body>
24
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>bound (String)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/string.rb, line 30</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bound</span>
15
+ [<span class="ruby-ivar">@@min_range</span>, <span class="ruby-ivar">@@max_range</span>]
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>random_range (String)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/string.rb, line 34</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">random_range</span>(<span class="ruby-identifier">gen</span>, <span class="ruby-identifier">lo</span>=<span class="ruby-ivar">@@min_range</span>, <span class="ruby-identifier">hi</span>=<span class="ruby-ivar">@@max_range</span>)
15
+ <span class="ruby-identifier">len</span>, <span class="ruby-identifier">g</span> = <span class="ruby-constant">Integer</span>.<span class="ruby-identifier">random</span>(<span class="ruby-identifier">gen</span>, <span class="ruby-identifier">lo</span>, <span class="ruby-identifier">hi</span>)
16
+ <span class="ruby-identifier">result</span> = <span class="ruby-value str">''</span>
17
+ <span class="ruby-identifier">len</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
18
+ <span class="ruby-identifier">v</span>, <span class="ruby-identifier">g</span> = <span class="ruby-constant">Integer</span>.<span class="ruby-identifier">random</span>(<span class="ruby-identifier">g</span>, <span class="ruby-value">0</span>, <span class="ruby-value">127</span>)
19
+ <span class="ruby-identifier">result</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">chr</span>
20
+ <span class="ruby-keyword kw">end</span>
21
+
22
+ [<span class="ruby-identifier">result</span>. <span class="ruby-identifier">g</span>]
23
+ <span class="ruby-keyword kw">end</span></pre>
24
+ </body>
25
+ </html>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>coarbitrary (String)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/string.rb, line 45</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">coarbitrary</span>(<span class="ruby-identifier">g</span>)
15
+ <span class="ruby-identifier">r</span> = <span class="ruby-identifier">g</span>.<span class="ruby-identifier">variant</span>(<span class="ruby-value">0</span>)
16
+ <span class="ruby-identifier">each_byte</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
17
+ <span class="ruby-identifier">r</span> = <span class="ruby-identifier">c</span>.<span class="ruby-identifier">coarbitrary</span>(<span class="ruby-identifier">r</span>.<span class="ruby-identifier">variant</span>(<span class="ruby-value">1</span>))
18
+ <span class="ruby-keyword kw">end</span>
19
+ <span class="ruby-identifier">r</span>
20
+ <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>