Skip to content

Instantly share code, notes, and snippets.

def compare(correctList, newList, scope):
"""
A method to compare two list which are not necessarily the same but should be regarded as the same.
The 2 input lists are supposed to have the same items and the same length, also no duplicates are allowed.
Parameters
----------
correctList: the list where the new list is compared to
newList: the list which is compared to the correct list
scope: the number of places before and behind an item
@warreee
warreee / separator.hs
Created August 28, 2015 07:15
Separate a string based on '/' so you can past it easily in e.g. Google Sheets.
import Control.Monad
sep [] = []
sep xs = word : sep ((drop ((length word) + 1) xs))
where word = takeWhile (/= '/') xs
main = do
xs <- getLine
putStrLn ""
mapM_ (\x -> putStrLn x) (sep xs)
putStrLn ""