Commit 16d9f095 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel 🐢

random-wta: Save random state to file instead of stderr

Hides ugly debug output from stderr but instead persists it in the generated
file, in case someone wants to re-generate it (e.g. after fixing a bug in the
generator).
parent 4d435c66
...@@ -111,6 +111,7 @@ main = do ...@@ -111,6 +111,7 @@ main = do
Just x -> setStdGen x Just x -> setStdGen x
withSpec opts $ \spec -> do withSpec opts $ \spec -> do
getStdGen >>= hPutStrLn stderr . ("Random state: " <>) . show randGen <- getStdGen
wta <- runGenerator (GeneratorConfig spec (optZeroFrequency opts)) genWTA wta <- runGenerator (GeneratorConfig spec (optZeroFrequency opts)) genWTA
putStrLn $ "# Random state for this automaton: '" <> show randGen <> "'"
T.putStr (Build.toLazyText (buildWTA wta)) T.putStr (Build.toLazyText (buildWTA wta))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment