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
-- Collision Detection Challenge | |
function RandomizeWall() | |
Wall.x = math.random(0, 200) | |
Wall.y = math.random(24, 100) | |
Wall.width = math.random(8, 100) | |
Wall.height = math.random(8, 100) | |
end | |
function IsColliding() |
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
function BOOT() | |
Player = CreateActor(50, 50, 12, 12, 1, 0, 0) | |
Enemies = {} | |
table.insert(Enemies, CreateActor(90, 70, 8, 8, 2, 1, 1)) | |
table.insert(Enemies, CreateActor(10, 10, 4, 4, 3, -2, -1)) | |
table.insert(Enemies, CreateActor(10, 30, 5, 5, 4, -3, -2)) | |
table.insert(Enemies, CreateActor(20, 10, 6, 6, 7, -1, -2)) | |
end | |
function CreateActor(x, y, w, h, c, vx, vy) |
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
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 |
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
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 |
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
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. |
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 StartApp | |
import History | |
import Html | |
import Html.Events as Events | |
import Effects | |
import Task | |
import Signal | |
import Graphics.Element exposing (show) | |
import List |
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 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 = [] |
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
{ | |
"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", |
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.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 |
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 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 |