Permalink
Browse files

Update zvm with new xorshift generator

  • Loading branch information...
curiousdannii committed Jul 21, 2016
1 parent 71fc32c commit f458c458db2da19cc9efd253394cd5fe537bbe8b
Showing with 12 additions and 13 deletions.
  1. BIN lib/parchment-for-inform7.zip
  2. +8 −9 lib/zvm.debug.js
  3. +3 −3 lib/zvm.min.js
  4. +1 −1 src/ifvms.js
View
BIN +3 Bytes (100%) lib/parchment-for-inform7.zip
Binary file not shown.
View
@@ -3,9 +3,9 @@
ZVM - the ifvms.js Z-Machine (versions 5 and 8)
===============================================
Built: 2015-09-06
Built: 2016-07-21
Copyright (c) 2011-2015 The ifvms.js team
Copyright (c) 2011-2016 The ifvms.js team
BSD licenced
http://github.com/curiousdannii/ifvms.js
@@ -1742,7 +1742,7 @@ var VM = Class.subClass({
Z-Machine runtime functions
===========================
Copyright (c) 2015 The ifvms.js team
Copyright (c) 2016 The ifvms.js team
BSD licenced
http://github.com/curiousdannii/ifvms.js
@@ -2190,12 +2190,11 @@ TODO:
// Based on the discussions in this forum topic, we will not implement the sequential mode recommended in the standard
// http://www.intfiction.org/forum/viewtopic.php?f=38&t=16023
// Instead implement a 16 bit Xorshift generator taken from
// http://b2d-f9r.blogspot.com.au/2010/08/16-bit-xorshift-rng.html
seed ^= ( seed << 4 ) & 0xFFFF;
seed ^= ( seed >> 3 ) & 0xFFFF;
this.xorshift_seed = ( seed ^= ( seed << 7 ) & 0xFFFF );
return 1 + ( seed % range );
// Instead implement a 32 bit Xorshift generator
seed ^= ( seed << 13 );
seed ^= ( seed >> 17 );
this.xorshift_seed = ( seed ^= ( seed << 5 ) );
return 1 + ( ( seed & 0x7FFF ) % range );
},
// Request line input
Oops, something went wrong.

0 comments on commit f458c45

Please sign in to comment.