This file contains 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
(defn p112-take1 [n d] | |
(letfn [(recast-to-vec [acc] | |
(let [num-left (count (re-seq #"\[" (apply str acc))) | |
num-right (count (re-seq #"\]" (apply str acc))) | |
updated-seq (concat acc (repeat (- num-left num-right) "]"))] | |
(read-string (apply str (interpose " " updated-seq))))) | |
(recast-to-int [s] | |
(Integer. (clojure.string/replace s #"[\]\[]" "")))] | |
(loop [acc-value 0 | |
acc-structure [] |
This file contains 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 sys | |
text = sys.argv[1] | |
print text |
This file contains 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
| Surround parens | M-shift-9 | | |
| slurp right | ctrl-shift-right_arrow | | |
| barf right | ctrl-shift-left_arrow | | |
| slurf left | ctrl-shift-9 | |
This file contains 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
port module SubanagramGenerator exposing (..) | |
import Html exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (..) | |
import Html.App as App | |
import String exposing (toLower, toList) | |
import Ni2Dictionary | |
import Char exposing (isLower) | |
import Dict exposing (Dict) |
This file contains 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
(ns faceoff.core) | |
;; Make deck of cards, shuffle | |
;; loop: | |
;; does a player have zero cards? | |
;; if yes: game over | |
;; if no: faceoff | |
;; determine winner, winner gets cards added | |
;; if tie: | |
;; does 1 player have < 5 cards |
This file contains 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
; https://gist.github.com/Youenn-Bouglouan/02cd3ac6fd0130cc48b207eec6049af6 | |
; | |
; http://www.ybouglouan.pl/2017/03/are-you-polish-fharp-will-tell-us-probably/ | |
(defn are-you-polish? [surname] | |
(letfn [(score-polish-characters | |
[surname] | |
(->> (re-seq #"[ąćęłńóśżź]" surname) | |
count)) |
This file contains 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
Count[Characters@ToLowerCase@WolframAlpha["1971 texas rangers roster", {{"Result", 1}, "Plaintext"}, PodStates -> {"More"}], "z"]; | |
MLBTeams = Drop[StringSplit[WolframAlpha["all major league baseball teams", {{"Result", 1}, "Plaintext"}, PodStates -> {"More", "More"}], {"(", "|"}], -1]; | |
Grid[Take[Reverse@SortBy[First@Table[{team, yr, Count[Characters@ToLowerCase@WolframAlpha[ToString[yr] <> " " <> team <> " roster", {{"Result", 1}, "Plaintext"}, PodStates -> {"More"}], "z"]}, {team, MLBTeams}, {yr, Range[1903, 2016]}], Last], 40], Frame-> All] |
This file contains 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
#!/usr/bin/python | |
# subanagram.py | |
# This program receives as input an English word, and then | |
# delivers as output those English words which can be spelled with the | |
# letters in the input word. | |
# This script is Copyleft 2002, 2012 by Mitchell Szczepanczyk under the | |
# terms of the General Public License. Anyone is free to copy, modify, |
This file contains 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
#!/usr/bin/perl | |
# subanagram.pl | |
# This program receives as input an English word, and then | |
# delivers as output those English words which can be spelled with the | |
# letters in the input word. | |
# This script is Copyleft 2002 by Mitchell Szczepanczyk under the | |
# terms of the General Public License. Anyone is free to copy, modify, |
This file contains 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
#!/usr/local/bin/perl | |
# subanagram.pl | |
# This program receives as input an English word, and then | |
# delivers as output those English words which can be spelled with the | |
# letters in the input word. | |
# This script is Copyleft 2002 by Mitchell Szczepanczyk under the | |
# terms of the General Public License. Anyone is free to copy, modify, |