- Elm v0.15.1
-
Fork this repository:
https://github.com/robwhitaker/MMPHalloween2015
-
cd
into the forked folder and runelm package install
-
Once the packages are installed, run
elm reactor
import Graphics.Collage (..) | |
import Graphics.Element (..) | |
import Color (blue) | |
import Text (plainText) | |
import Window | |
import Signal | |
import Mouse | |
main : Signal Element | |
main = Signal.map3 (\x y m -> let |
class Shape { | |
var title = "shape" | |
func area() -> Double { | |
return 0.0 | |
} | |
func description() -> String { | |
return "I am a \(title). My area is \(area())." | |
} |
function ReadyListener(config) { | |
this.properties = config || {}; | |
this.onReady = function() {}; | |
} | |
ReadyListener.prototype.ready = function(key) { | |
this.properties[key] === false && (this.properties[key] = true); | |
var isReady = true; | |
for(k in this.properties) isReady = isReady && this.properties[k]; | |
isReady && this.onReady(); |
import Graphics.Element exposing (..) | |
import Window | |
import Graphics.Input exposing (..) | |
main : Signal Element | |
main = Signal.map content Window.dimensions | |
divI a b = round (toFloat a / b) | |
content : (Int, Int) -> Element |
// Write a function `hipsterfy(sentence)` that takes takes a string containing | |
// several words as input. Remove the last vowel from each word. `'y'` is not a vowel. | |
function isVowel(char) { | |
return ["a","e","i","o","u"].indexOf(char.toLowerCase()) !== -1; | |
} | |
function hipsterfy(str) { | |
return str.split("").reverse().reduce(function(acc, char) { | |
if(isVowel(char) && acc.needLastVowel) |
function hasDuplicates(arr) { | |
var exists = {}; | |
for(var i = 0; i < arr.length; i++) | |
if(exists[arr[i]]) | |
return true; | |
else | |
exists[arr[i]] = true; | |
return false; | |
} |
function mindPsAndQs(input) { | |
return input.match(/[PQ]+/g).reduce(function(acc, str) { | |
return Math.max(acc, str.length); | |
}, 0); | |
} |
Note:
You can download Tweego from the (hard to find) Tweego page on the Motoslave website. Compiled executables are available for Windows, Mac, and Linux, or you can follow the link on that page to Bitbucket to compile it yourself from source (instructions on Bitbucket).
There is no installer. Once you download the executable, add it to your PATH
and you're all set to use Tweego...
set smoothscroll | |
set autohidecursor | |
set noautofocus | |
set sortlinkhints | |
set scalehints | |
set autoupdategist | |
let searchengine duckduckgo = ["https://duckduckgo.com", "https://duckduckgo.com/?q="] | |
let searchengine ecosia = ["https://www.ecosia.org", "https://www.ecosia.org/search?q="] | |
let searchengine startpage = ["https://www.startpage.com", "https://www.startpage.com/do/search?query="] |