* DONE initial model parametrization
* DONE view parameterization?
* DONE troll races
-* TODO html for salting the seed
+* DONE html for salting the seed
* BUGS
** viewer goes blank <2020-06-03 mer. 22:58>
(22:19:12) Astrobytes: JBM, if you're around, the TVC viewer goes blank after a couple of games. Consistently. In Chrome. Other games not doing the same.
</div>
</div>
</div>
+ <div class="statement-section statement-examples">
+ <h2>
+ <span class="icon icon-example"> </span>
+ <span>Proper RNG seeding examples</span>
+ </h2>
+ <table>
+ <tr>
+ <th style="border-bottom: 2px dashed #f2bb13;">Language Family</th>
+ <th style="border-bottom: 2px dashed #f2bb13;">Sample</th>
+ </tr>
+ <tr>
+ <td style="border-bottom: 1px dashed #f2bb13;">JVM</td>
+ <td style="border-bottom: 1px dashed #f2bb13;"><code>
+ long mySecretSalt = 0x4242424242424242L;<br>
+ Random random = new Random(gameSeed ^ gameSide ^ mySecretSalt);
+ </code></td>
+ </tr>
+ <tr>
+ <td style="border-bottom: 1px dashed #f2bb13;">C, C++, Perl…</td>
+ <td style="border-bottom: 1px dashed #f2bb13;"><code>
+ srand(gameSeed ^ gameSide ^ 0xdeadb33f);<br>
+ std::srand(gameSeed ^ gameSide ^ 12345);<br>
+ srand( $gameSeed ^ $gameSide ^ 0xCAFE_BABE );
+ </code></td>
+ </tr>
+ <tr>
+ <td style="border-bottom: 1px dashed #f2bb13;">Other</td>
+ <td style="border-bottom: 1px dashed #f2bb13;">Unachievable until proven otherwise</td>
+ </tr>
+ </table>
+ </div>
<div class="statement-section statement-expertrules">
<h2>
<span class="icon icon-expertrules"> </span>
};
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
- Random random = new Random();
int roadLength = in.nextInt();
int initialStones = in.nextInt();
+ long gameSeed = in.nextLong();
+ int gameSide = in.nextInt();
in.nextLine();
+ long mySecretSalt = 0x4242424242424242L;
+ Random random = new Random(gameSeed ^ gameSide ^ mySecretSalt);
while (true) {
int trollDistance = in.nextInt();