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
/** | |
* @param {String} msg 错误信息 | |
* @param {String} url 出错的文件 | |
* @param {Long} line 出错代码的行号 | |
* @param {Long} col 出错代码的列号 | |
* @param {Object} error 错误的详细信息,Anything | |
*/ | |
window.onerror = function(msg,url,line,col,error){ | |
//没有URL不上报!上报也不知道错误 | |
if (msg != "Script error." && !url){ |
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
contract Gamble { | |
function Gamble() { | |
owner = msg.sender; | |
address nameReg = 0x72ba7d8e73fe8eb666ea66babc8116a41bfb10e2; | |
nameReg.callstring32string32("register", "UltimateGamble"); | |
} | |
function gamble(uint luckyNumber) { | |
value = value+ msg.value; | |
hash randomness = sha3(block.prevhash ^ hash(msg.sender) ^ luckyNumber); |
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
import assert from 'assert' | |
import { NeuralNetwork, Model, Academy } from "reimprovejs/dist/reimprove.js" | |
const TIMEOUT = 1; // mins | |
const MAP_SIZE = 10; | |
function randomPoint() | |
{ | |
let min = 0; | |
let max = MAP_SIZE; |