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
pragma solidity ^0.8.0; | |
// SPDX-License-Identifier: UNLICENSED | |
contract Kittycontract { | |
string public constant name = "TestKitties"; | |
string public constant symbol = "TK"; | |
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); |
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> | |
<meta charset="UTF-8" /> | |
<title>Hello React</title> | |
<script src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script> | |
</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
React.createElement( | |
"div", { | |
id: "hello" | |
}, | |
React.createElement( | |
"p", | |
null, | |
"Lorem, ipsum." | |
) | |
); |
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
pragma solidity 0.7.0; | |
// SPDX-License-Identifier: UNLICENSED | |
contract Prison{ | |
/// A "judge" is just a privilaged address. | |
struct Prisoner{ | |
uint256 number; | |
uint256 age; |
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
pragma solidity 0.7.0; | |
// SPDX-License-Identifier: UNLICENSED | |
contract Lineup { | |
// Instead of having a mapping where we store people... | |
struct Person{ | |
// Modify the person struct... | |
string name; | |
string species; |
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
function range(start, end, step = 1){ | |
// expand a range | |
// presumes integer inputs. | |
let pile = []; // typecast for members. | |
if (start > end){ | |
end = [start, start = end][0]; | |
} | |
do{ pile.push(start); | |
} while ((start+=Math.abs(step)) <=end); | |
if (step < 0) reverseArrayInPlace(pile); |
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> | |
<header> | |
<!-- Load jQuery --> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"> </script> | |
</header> | |
<body> | |
<!-- Define Buttons --> |
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
function isGreaterThan(num1,num2){ | |
return(num2 > num1); | |
} |
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
// write a function called "isOldEnoughToDrink" | |
function isOldEnoughToDrink(age){ | |
// Given a number, in this case an age | |
// return validity of drinking in the US | |
if (age >=21){ | |
return (true); | |
}else { | |
return (false); | |
} | |
} |