<commit_before>{-# LANGUAGE OverloadedStrings #-}
module Mazes where

import qualified Data.Map as Map
import qualified Data.Maybe as Maybe

type Cell = (Int,Int)
type Board = Map.Map Cell Bool

toChar x = if x then "a" else " "
toBool = Maybe.fromMaybe False

toStringMap :: Board -> String
toStringMap m l w =
  let ks = Map.keys m
      topRow = filter ((==0).snd) ks
      topString = foldl (\ret k -> ret++((toChar . toBool . Map.lookup m) k)) "" topRow
  in topString

generate = do
  putStrLn "abcdef                           "
  putStrLn "     g                           "
  putStrLn "     h                           "<commit_msg>Printing the map<commit_after>{-# LANGUAGE OverloadedStrings #-}
module Mazes where

import qualified Data.Map as Map
import qualified Data.Maybe as Maybe

type Cell = (Integer,Integer)
type Board = Map.Map Cell Bool

emptyBoard =
  let m = Map.empty
      coords = [(x,y) | x <- [0..20], y <- [0..7]]
  in foldl (\m k -> Map.insert k False m) m coords

sampleBoard =
  let m = emptyBoard
  in foldl (\m k -> Map.insert k True m) m [(0,0), (1,0), (2,0), (4,0), (1,2) ]

toChar :: Bool -> String
toChar x = if x then "a" else " "

toBool = Maybe.fromMaybe False

toStringRow :: Board -> Integer -> String
toStringRow m y =
  let ks = Map.keys m
      topRow = filter ((==y).snd) ks
      topString = foldl (\ret k -> ret++((toChar . toBool . Map.lookup k) m)) "" topRow
  in topString

toStringMap :: Board -> [String]
toStringMap m =
  map (\y -> toStringRow m y) [0..7]

printMap =
  sequence . (map putStrLn) $ toStringMap sampleBoard

generate = do
  putStrLn "abcdef                           "
  putStrLn "     g                           "
  putStrLn "     h                           "
{'fraction_non_alphanumeric': 0.12175418349682632, 'fraction_numerical': 0.0103866128101558, 'mean_word_length': 2.0854092526690393, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4280786', 'n_tokens_mistral': 584, 'n_tokens_neox': 578, 'n_words': 198}