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
interface ICoordinate { | |
x: number; | |
y: number; | |
} | |
export default class WireCalculator { | |
constructor() { | |
const distanceToClosestIntersection = this.calculateClosestIntersection(['R1005', 'D32', 'R656', 'U228', 'L629', 'U59', 'L558', 'D366', 'L659', 'D504', 'R683', 'U230', 'R689', 'U489', 'R237', 'U986', 'L803', 'U288', 'R192', 'D473', 'L490', 'U934', 'L749', 'D631', 'L333', 'U848', 'L383', 'D363', 'L641', 'D499', 'R926', 'D945', 'L520', 'U311', 'R75', 'D414', 'L97', 'D338', 'L754', 'U171', 'R601', 'D215', 'R490', 'U164', 'R158', 'U499', 'L801', 'U27', 'L671', 'D552', 'R406', 'U168', 'R12', 'D321', 'L97', 'U27', 'R833', 'U503', 'R950', 'U432', 'L688', 'U977', 'R331', 'D736', 'R231', 'U301', 'L579', 'U17', 'R984', 'U399', 'L224', 'U100', 'L266', 'U184', 'R46', 'D989', 'L851', 'D739', 'R45', 'D231', 'R893', 'D372', 'L260', 'U26', 'L697', 'U423', 'L716', 'D573', 'L269', 'U867', 'R722', 'U193', 'R889', 'D322', 'L743', 'U371', 'L986', 'D835', 'R534', 'U170', 'R946', 'U271', 'L514', 'D521', 'L781', |
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
export default class RocketComputer { | |
constructor() { | |
let opCode = [1, 12, 2, 3, 1, 1, 2, 3, 1, 3, 4, 3, 1, 5, 0, 3, 2, 1, 10, 19, 1, 6, 19, 23, 1, 13, 23, 27, 1, 6, 27, 31, 1, 31, 10, 35, 1, 35, 6, 39, 1, 39, 13, 43, 2, 10, 43, 47, 1, 47, 6, 51, 2, 6, 51, 55, 1, 5, 55, 59, 2, 13, 59, 63, 2, 63, 9, 67, 1, 5, 67, 71, 2, 13, 71, 75, 1, 75, 5, 79, 1, 10, 79, 83, 2, 6, 83, 87, 2, 13, 87, 91, 1, 9, 91, 95, 1, 9, 95, 99, 2, 99, 9, 103, 1, 5, 103, 107, 2, 9, 107, 111, 1, 5, 111, 115, 1, 115, 2, 119, 1, 9, 119, 0, 99, 2, 0, 14, 0]; | |
let problem1Result = this.calculateIntCodeList(opCode); | |
console.log('position 0 number: ', problem1Result[0]); | |
let problem2Result = this.calculateIntCodeNounAndVerb(opCode, 19690720); | |
console.log('100 * noun + verb is: ', problem2Result); | |
} | |
public calculateIntCodeList(memory: number[]): number[] { |
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
let ckAddress = '0x06012c8cf97bead5deae237070f9587f8e7a266d'; | |
web3.eth.defaultAccount = web3.eth.accounts[0]; | |
let aContract = web3.eth.contract(ckABI); | |
let ckContract = aContract.at(ckAddress); | |
let value = web3.toWei(0.008, 'ether') | |
let data = ckContract.breedWithAuto.getData(pair.matronId, pair.sireId); |
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
let breedData = await ckContract.breedWithAuto(pair.matronId, pair.sireId, function(err, response){ | |
console.log('err',err,'response',response) | |
}) |
NewerOlder