This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Avakids by @avanet | |
| /****************************************************************** | |
| --LilyPad Light Sensor Trigger - Automatic Night Light | |
| --By KOOKYE | |
| This example code reads the input from a LilyPad Light Sensor compares it to | |
| a set threshold named 'dark'. If the light reading is below the threshold, | |
| three LEDs will turn on and a tri-color led will change the color. | |
| Light Sensor connections: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import System.Random | |
| check :: String -> String -> Char -> (Bool, String) | |
| check word display c | |
| = (c `elem` word, [if x == c | |
| then c | |
| else y | (x,y) <- zip word display]) | |
| turn :: String -> String -> Int -> IO () | |
| turn word display n = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getLetter :: [Char] -> [Char] | |
| getLetter word = | |
| take 1 word | |
| createSinglePhrase :: [Char] -> [Char] | |
| createSinglePhrase word = | |
| getLetter word ++ " is for " ++ word | |
| createPhrase :: [Char] -> [[Char]] -> [Char] | |
| createPhrase word lst = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- import Data.Char | |
| import System.Random | |
| check :: String -> String -> Char -> (Bool, String) | |
| check word display c | |
| = (c `elem` word, [if x == c | |
| then c | |
| else y | (x,y) <- zip word display]) | |
| turn :: String -> String -> Int -> IO () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const readline = require('readline') | |
| const R = require('ramda') | |
| const rl = readline.createInterface({ | |
| input: process.stdin, | |
| output: process.stdout | |
| }) | |
| const question = (question) => { | |
| return new Promise(function (resolve) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getLetter :: [Char] -> [Char] | |
| getLetter word = | |
| take 1 word | |
| createSinglePhrase :: [Char] -> [Char] | |
| createSinglePhrase word = | |
| getLetter word ++ " is for " ++ word | |
| createPhrase :: [Char] -> [[Char]] -> [Char] | |
| createPhrase word lst = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const getLetter = (word) => { | |
| return word[0] | |
| } | |
| const createSinglePhrase = (word) => { | |
| return `${getLetter(word)} is for ${word}` | |
| } | |
| const createPhrase = (word, lst) => { | |
| return lst.length === 1 ? |
OlderNewer