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
enchant(); // 初期化 | |
var FPS = 30; // フレームレート | |
var MAX_ROW = 14+1; // 縦のマス数 | |
var MAX_COL = 6+2; // 横のマス数 | |
var CELL_SIZE = 16; // マスのサイズ(ぷよのサイズ) | |
var PUYOS_IMG = "puyos.png" // 壁とぷよの画像 | |
window.onload = function () { |
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
# -*- coding: utf-8 -*- | |
import requests | |
from BeautifulSoup import BeautifulSoup | |
import urlparse | |
def get(url): | |
"""URLからフィードURLをリトリーブします。 | |
もしも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
# -*- coding: utf-8 -*- | |
from django.http import HttpResponse, HttpResponseRedirect | |
from django.template import RequestContext, loader | |
import urlparse | |
import oauth2 as oauth | |
# OAuthの設定 | |
CONSUMER_KEY = '' | |
CONSUMER_SECRET = '' |
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
# -*- coding: utf-8 -*- | |
import base64 | |
import datetime | |
import hashlib | |
import random | |
import requests | |
import time | |
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
var SCREEN_SIZE = 500; // キャンバスの幅 | |
var SIDE_CELLS = 200; // 一辺のセルの数 | |
var CELL_SIZE = SCREEN_SIZE / SIDE_CELLS; // セルの幅 | |
var FPS = 10; // フレームレート | |
var canvas; //= document.getElementById('world'); | |
var context; //= canvas.getContext('2d'); | |
window.onload = function() { | |
var field = new Array(SIDE_CELLS*SIDE_CELLS); // フィールド情報 | |
var tempField = new Array(SIDE_CELLS*SIDE_CELLS); // フィールド情報の一時記憶用 |
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
var SCREEN_SIZE = 500; // キャンバスのサイズ | |
var SIDE_CELLS = 200; // 一辺のセルの数 | |
var CELL_SIZE = SCREEN_SIZE / SIDE_CELLS; // 1マスの幅 | |
var FPS = 200; // フレームレート | |
var canvas; // キャンバス | |
var context; // コンテキスト | |
var dirs = [ // アリの方向用配列 | |
{'row': -1, 'col': 0}, | |
{'row': 0, 'col': 1}, | |
{'row': 1, 'col': 0}, |
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
// 定数 | |
var SCREEN_SIZE = 600; | |
var FPS = 30; | |
var NUM_BOIDS = 200; // ボイドの数 | |
var BOID_SIZE = 3; // ボイドのサイズ | |
var VISIBLE_RANGE = 100; // ボイドの可視範囲 | |
var IDEAL_DIST = 10; // ボイドとボイドの理想距離 | |
var MAX_SPEED = 5; // ボイドの最大速度 | |
var canvas = document.getElementById('world'); |
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
// 定数 | |
var FPS = 30; // フレームレート | |
var SCREEN_SIZE = 500; // 画面サイズ | |
var NUM_BOIDS = 100; // ボイドの数 | |
var BOID_SIZE = 5; // ボイドの大きさ | |
var MAX_SPEED = 7; // ボイドの最大速度 | |
var canvas = document.getElementById('world'); | |
var ctx = canvas.getContext('2d'); | |
var boids = []; // ボイド |
OlderNewer