Created
February 8, 2018 15:15
-
-
Save anonymous/caa0ca3cc852420d998c711f5d2b1119 to your computer and use it in GitHub Desktop.
Exported from Popcode.
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> | |
<head> | |
<title>ScriptEd Robot 1</title> | |
<link href="https://fonts.googleapis.com/css?family=Space+Mono|Audiowide" rel="stylesheet"> | |
</head> | |
<body> | |
<h1> ScriptEd Robot</h1> | |
<img src="https://images-mm.s3.amazonaws.com/Futurama_Bender_Face_Gray_Shirt_POP.jpg"> | |
<div> | |
<input id="inputA" placeholder="A"> | |
<input id="inputB" placeholder="B"> | |
</div> | |
<br> | |
<div> | |
<button id="add">A + B</button> | |
<!-- Write all of your other buttons here --> | |
</div> | |
<br> | |
<div> | |
Answer = <span id="result"></span> | |
</div> | |
</body> | |
</html> |
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
{"enabledLibraries":["jquery"],"hiddenUIComponents":["console","editor.css"]} |
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
///////////////////////////////////// | |
// Define your robot functions | |
///////////////////////////////////// | |
// Add (+) | |
function add(inputA, inputB) { | |
return parseInt(inputA) + parseInt(inputB); | |
} | |
// Subtract (-) | |
// Multiply (*) | |
// Divide (/) | |
// (A + B) / 2 | |
// Say hello | |
///////////////////////////////////// | |
// Define your click handlers | |
///////////////////////////////////// | |
// Add (+) | |
$('#add').click(function() { | |
// What do you want to do when the "+" button is clicked? | |
var inputA = $("#inputA").val(); | |
var inputB = $("#inputB").val(); | |
var result = add(inputA, inputB); | |
$("#result").text(result); | |
}); | |
// Subtract (-) | |
// Multiply (*) | |
// Divide (/) | |
// (A + B) / 2 | |
// Say hello | |
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
img { | |
height:180px; | |
} | |
h1{ | |
font-family: 'Audiowide', cursive; | |
font-size:48px; | |
margin:0px; | |
} | |
body{ | |
text-align:center; | |
} | |
input { | |
font-size:12px; | |
text-align: center; | |
} | |
div { | |
margin-top:3px; | |
font-family: 'Space Mono', monospace; | |
font-size: 24px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment