diff --git a/not-so-random.html b/not-so-random.html
index 48c04da..168a287 100644
--- a/not-so-random.html
+++ b/not-so-random.html
@@ -169,8 +169,12 @@
randomHelpFunc = function(evt) {
evt.preventDefault();
//document.onkeydown = null;
- for (let i = 0; i<10; i++) {
- lastKey = Math.round(Math.random());
+
+ // db(2, 6)
+ var inputString = "0000001000011000101000111001001011001101001111010101110110111111";
+
+ for (let i = 0; i< inputString.length; i++) {
+ lastKey = inputString[i] == "0" ? 1 : 0;
testPrediction();
updateAll();
predictNext() diff --git a/not-so-random.html b/not-so-random.html
index 48c04da..c650b5b 100644
--- a/not-so-random.html
+++ b/not-so-random.html
@@ -169,8 +169,12 @@
randomHelpFunc = function(evt) {
evt.preventDefault();
//document.onkeydown = null;
- for (let i = 0; i<10; i++) {
- lastKey = Math.round(Math.random());
+
+ // db(2, 6)
+ var inputString = "0000001000011000101000111001001011001101001111010101110110111111";
+
+ for (let i = 0; i< inputString.length; i++) {
+ lastKey = inputString[i] == "0" ? 0 : 1;
testPrediction();
updateAll();
predictNext()
You can first sort all the lines, and count them. The first column is now the number of instances of that line.
The idea is that if 2 lines are identical, the number of "count++" emitted will be exactly the same.
I took your gawk code, but I am starting the for loop at 2 instead of 1, and I removed the -F'\t' option.
Edit: added backslashes to split lines.