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> | |
<?php | |
//とにかく1文字にしたい時 | |
function num2char($input) | |
{ | |
if($input<10) | |
return chr(ord('0') + $input); | |
else | |
return chr(ord('a') + ($input-10)); | |
} |
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 <stdio.h> | |
#include <time.h> | |
#include<string.h> | |
#include<stdlib.h> | |
#include "MT.h" | |
/* | |
基本的な処理の関数 | |
*/ | |
//min~maxの乱数発生 | |
int dice(int min, int max){ |
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
// Fill the empty space with the minimum number of rectangles. | |
// (Rectangles should not overlap each other or walls.) | |
// The grid size is 1 meter, but the smallest wall/floor tile is 4 meters. | |
// Check the blue guide button at the top for more info. | |
// Make sure to sign up on the home page to save your code. | |
var grid = this.getNavGrid().grid; | |
var tileSize = 4; | |
var width = tileSize; | |
for(var y = 0; y + tileSize < grid.length; y += tileSize) { |
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
/* | |
checkFunc(sq,10) で [100,1000] | |
checkFunc(mul,10,20) で [200,2000] | |
が返ってくる([結果,実行時間],※実行時間はズレることもある) | |
*/ | |
//関数と引数から結果と実行時間を返す関数 | |
function checkFunc(func){ | |
//2番目以降の引数を配列として取得(?) | |
var args = Array.prototype.slice.call(arguments,1); | |
// console.log(func); |