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
--For Euler Problem 17 | |
onesNames = ["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine"] | |
teenNames = ["Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"] | |
tensNames = ["", "","Twenty","Thirty","Forty","Fifty","Sisty","Seventy","Eighty","Ninety"] | |
numberToName x = (thousands x) ++ (hundreds x) ++ (addAnd x) ++ (tens x) ++ (ones x) | |
thousands x = | |
if digit > 0 | |
then (onesNames !! digit) ++ "Thousand" |
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
first (x,_,_) = x | |
second (_,x,_) = x | |
third (_,_,x) = x | |
triangle = | |
[ | |
[75], | |
[95,64], | |
[17,47,82], |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="x-ua-compatible" content="ie=edge, chrome=1" /> | |
<title>untitled</title> | |
<link rel="stylesheet" href="" /> | |
</head> | |
<body> |
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
<!DOCTYPE html> | |
<html> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>TITLE</title> | |
<body> | |
<!-- HTML ELEMENTS HERE --> | |
<script> |
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
# Hold b to show squares (circles stay hidden) | |
# Press space to reset | |
# @param [GTK::Args] args | |
def tick(args) | |
args.outputs.lines << args.state.lines if args.state.lines | |
init(args) unless args.state.initialized && !args.inputs.keyboard.key_down.space | |
rerender(args) unless args.state.render_ready && !args.inputs.keyboard.key_down.space && !args.inputs.keyboard.key_down.b && !args.inputs.keyboard.key_up.b | |
pos = args.inputs.mouse.position | |
pos ||= [640, 360] |
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
# l to toggle lines | |
# space to reset | |
# left click to attract | |
# right click to repel | |
$TIME_FACTOR = 1.0 | |
$X_WRAP = true | |
$Y_WRAP = true | |
# @param [GTK::Args] args | |
def tick(args) |
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
def tick(args) | |
unless args.state.model | |
args.state.model = Object3D.new('data/lowpoly_teapot.off') | |
args.state.model.fast_3x3_transform!(rotate3D(0.2, 0.0, 0.0)) | |
args.state.spin_mtx = rotate3D(0.00, 0.00, 0.01) | |
args.outputs.static_lines << args.state.model.edges | |
end | |
args.state.model.fast_3x3_transform!(args.state.spin_mtx) | |
end |
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
# @return [Array<Hash>] | |
# @param [Float] x1 | |
# @param [Float] y1 | |
# @param [Float] x2 | |
# @param [Float] y2 | |
# @param [Float] x3 | |
# @param [Float] y3 | |
# @param [Float] r | |
# @param [Float] g | |
# @param [Float] b |