Skip to content

Instantly share code, notes, and snippets.

using System;
public class ReadValidInputExample
{
/// Summary:
/// Prompts the user to enter an integer that is greater than 1000. Then,
/// returns the users input as an int. If the user enters an invalid valud,
/// this method will continue to prompt the user.
///
/// Returns:
/// The users input as an integer
1 Aether Tradewinds
1 Atarka's Command
1 Burnished Hart
1 Cascading Cataracts
1 Chandra, Awakened Inferno
1 Chandra's Embercat
1 Cloudkin Seer
1 Cloudthresher
1 Clutch of Currents
1 Courser of Kruphix
def buildGroups(list, conditionChecker):
'''
Takes in a list and compiles a set of groups based on the condition checker
@param list - a list of items to be compiled into groups
@param conditionChecker - the condition checker which takes in the current group being built,
the list of groups built thus far and the current item being inspected.
If the item should be added to the current group, it returns true.
Otherwise, the current group is added to the list of groups and the item is skipped.
import StartApp
import History
import Html
import Html.Events as Events
import Effects
import Task
import Signal
import Graphics.Element exposing (show)
import List
import Html exposing (div, button, text, input, node)
import Html.Events exposing (onClick)
import Html.Attributes exposing (type', class)
import StartApp
main =
StartApp.start { model = model, view = view, update = update }
model = []
@jcollard
jcollard / 1.0.2.json
Created December 4, 2014 14:30
elm-doc src/Playground/Input.elm
{
"name": "Playground.Input",
"comment": "\n\n This module explains each type of Input that can be used in a Playground's\n update function.\n\n @docs RealWorld, Input",
"aliases": [
{
"name": "RealWorld",
"comment": "\n The RealWorld record contains information about the environment of the running\n program.\n\n * The `top`, `right`, `bottom`, and `left` fields represent the bounding box\n that will be rendered.\n\n * The `mouse` field is a record containing the most recent x and y positions\n of the mouse within the rendered bounding box.",
"args": [],
"type": {
"tag": "record",
@jcollard
jcollard / OutlineExample.hs
Created October 24, 2013 23:44
Example usage of outline' on a ColorImage
import Data.Image
import Data.Image.Interactive
import System.IO.Unsafe
stopImage = unsafePerformIO $ do
stop <- readColorImage "images/stop.ppm"
return stop
binaryStop = (r + g + b) .> 196 where
(r, g, b) = colorImageToRGB stopImage
@jcollard
jcollard / circle.elm
Created October 8, 2013 19:34
Neat Spinning Thing! Tracing a circle that happens to be rotating around an ellipse that is wobbling.
import Automaton
import Graphics.Collage
-- parameters
areaSize = 400 -- size of area to draw in
size = 3 -- size of "pixel"
rate = 32 -- Refresh rate
trail = 100 -- How long
av = 3 -- angular velocity of the inner circle
av' = 5 -- angular velocity of the outer circle