Skip to content

Instantly share code, notes, and snippets.

buscarini / Mastermind.hs
Last active Sep 29, 2016
Mastermind game in Haskell
View Mastermind.hs
module Mastermind
import System.Random
import Text.Read
import Data.Maybe
import Data.Char
data Color = Red | Green | Blue | Yellow | Brown | Orange | Black | White deriving (Show, Read, Eq, Ord, Bounded, Enum)
buscarini /
Created Jul 15, 2015
Remove Xcode duplicated simulators
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from subprocess import Popen, PIPE
from subprocess import call
p = Popen(["xcrun","simctl","list","devices"], stdin=PIPE, stdout=PIPE, stderr=PIPE)
output, err = p.communicate(b"input data that is passed to subprocess' stdin")