<commit_before>module Life.Console where

import Life.Types
import System.Console.ANSI

lifeConsole :: Life board => board -> IO ()
lifeConsole = error ""

<commit_msg>Added ANSI terminal activity to Console.hs<commit_after>module Life.Console where

import Life.Types
import System.Console.ANSI
import Control.Concurrent

cls :: IO ()
cls = putStr "\ESC[2J"

goto :: Pos -> IO ()
goto (x,y) =  putStr ("\ESC[" ++ show y ++ ";" ++ show x ++ "H")

writeat :: Pos -> String -> IO ()
writeat p xs = do 	goto p
					putStr xs

lifeConsole :: Life board => board -> IO ()
lifeConsole b = do	cls
					sequence_ [writeat p "O" | p <- alive b]
					threadDelay (50 * 1000)
					lifeConsole (nextgen b)


{'fraction_non_alphanumeric': 0.1366906474820144, 'fraction_numerical': 0.010071942446043165, 'mean_word_length': 3.35, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2919116', 'n_tokens_mistral': 252, 'n_tokens_neox': 226, 'n_words': 79}