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.5.1; | |
contract MemorySolution { | |
mapping(uint => User) users; | |
struct User{ | |
uint id; | |
uint balance; | |
} |
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.5.12; | |
contract ModifierExample{ | |
struct Person { | |
uint id; | |
string name; | |
uint age; | |
uint height; | |
bool senior; |
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.5.12; | |
contract AssertExample{ | |
struct Person { | |
uint id; | |
string name; | |
uint age; | |
uint height; | |
bool senior; |
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.5.12; | |
contract RequireExample{ | |
struct Person { | |
uint id; | |
string name; | |
uint age; | |
uint height; | |
bool senior; |
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.5.12; | |
// Every user will be able to create their account data | |
// and then retrieve ONLY their record. | |
contract StructDemo{ | |
// stack variables | |
struct Person{ |
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.5.12; | |
contract StructDemo{ | |
// stack variables | |
struct Person{ | |
string name; | |
string species; | |
uint 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.5.12; | |
contract ArrayDemo { | |
uint64[] dynamicArray = [1, 2, 3]; | |
uint64[3] staticArray = [1,2,3]; | |
function getDynamicArray(uint64 index) public view returns(uint64){ | |
return dynamicArray[index]; | |
} | |
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.5.12; | |
contract HelloWorld{ | |
string public message = "Hello World."; | |
function getMessage() public view returns (string memory) { | |
return message; | |
} | |
function setMessage(string memory newMessage) public { |
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
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main(){ | |
string name = ""; | |
cout << "What is your name?" << endl; |
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
<html> | |
<head> | |
<h1>Text Entry Field.</h1> | |
<h2>Button to echo text in an alert</h2> | |
<</textarea> | |
</head> | |
<body> | |
<script src='http://code.jquery.com/jquery-latest.min.js' | |
type='text/javascript'></script> | |
<input id = "garbageIn" |
NewerOlder