Browse Source

tweaked random init; added scripts for testing remotely

Brandon Wong 7 years ago
parent
commit
2a6b8286d7
3 changed files with 25 additions and 1 deletions
  1. 7 0
      check.sh
  2. 1 1
      src/automata/init.cljs
  3. 17 0
      switch.sh

+ 7 - 0
check.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+grep -rn "localhost:3449" . | grep -v "check.sh" | grep -v "switch.sh"
+
+
+
+

+ 1 - 1
src/automata/init.cljs

@@ -1,7 +1,7 @@
 (ns automata.init)
 
 (defn init-random [size]
-  (repeatedly size #(if (< 0.5 (js/Math.random)) false true)))
+  (vec (repeatedly size #(if (< 0.5 (js/Math.random)) false true))))
 
 (defn init-from-binary [string]
   (map #(if (= % "1") true false) string))

+ 17 - 0
switch.sh

@@ -0,0 +1,17 @@
+#!/bin/bash
+
+
+for i in $(grep -r -l "localhost:3449" target/)
+do
+    sed -i 's/localhost:3449/10.0.0.186:3449/g' $i
+done
+
+for i in $(grep -r -l "localhost:3449" resources/)
+do
+    sed -i 's/localhost:3449/10.0.0.186:3449/g' $i
+done
+
+
+
+
+