Instantly share code, notes, and snippets.

# dev001hajipro

• Sort options
Created Mar 9, 2017
View cellular_automaton_rule30.js
 function initCanvas(w, h) { var canvas = document.getElementById("myCanvas"); canvas.width = w; canvas.height = h; canvas.style.width = w + "px"; canvas.style.height = h + "px"; return canvas.getContext('2d'); } function main() {
Created Mar 20, 2017
JavaScriptとCanvasでモンテカルロ法で円周率を求める
View 1.5.1.montecalro.html
 モンテカルロ法
Created Mar 26, 2017
p5.js word counter
View CodingChallenge40_WordCounter.html
 CodingChallenge40_WordCounter

Word Counter

Created Mar 30, 2017
pixel sort // source https://jsbin.com/nuyezac
View index.html
 pixel sort

Pixel sort

Created Apr 15, 2017
xtermでVLGothicフォントを大きくして、Molokaiテーマ。.Xresourcesに保存して、xrdb -merge ~/.Xresourcesで反映
View Xresources
 ! Molokai theme *xterm*background: #101010 *xterm*foreground: #d0d0d0 *xterm*cursorColor: #d0d0d0 *xterm*color0: #101010 *xterm*color1: #960050 *xterm*color2: #66aa11 *xterm*color3: #c47f2c *xterm*color4: #30309b *xterm*color5: #7e40a5
Created Apr 24, 2017
emscripten draw pixels and scale by SDL_RenderCopy
View build.bat
 emcc test_pixel2.c ^ -O2 ^ -Wall -Wextra -pedantic ^ -s USE_SDL=2 ^ -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS="[""png""]" ^ -s USE_SDL_TTF=2 ^ --preload-file assets ^ -o test_pixel2.html
Created Jun 18, 2017
Attractor and Repeller with OpenSiv3D library.
View Main.cpp
 # include #include #include #include using namespace std; inline double myrand(double min, double max) {
Created Jun 25, 2017
Vehicles implement by OpenSiv3D from The Nature of Code.
View openSiv3D_vehicle
 #include "stdafx.h" inline void _limit(Vec2& v, double a) { double b = v.lengthSq(); if (b > a*a) { v /= sqrt((float)b); } v *= a; } inline double heading(Vec2 v)
Last active Jun 28, 2017
flowfield with OpenSive3D
View Main.cpp
 #include #define _USE_MATH_DEFINES #include // p5.js helper functions for OpenSiv3D namespace p5h { template inline T map(T n, T start1, T stop1, T start2, T stop2) noexcept { return ((n - start1) / (stop1 - start1)) * (stop2 - start2) + start2; } inline void limit(Vec2& v, double a) noexcept {
Created Jul 23, 2017
OpenSiv3Dで簡単なポリゴンを表示。
View openSiv3D_simple_polygon
 # include // OpenSiv3D v0.1.5 // Polygonクラスを使った描画例と、 // 頂点配列とPolygonクラスを組み合わせた例。 void Main() { Window::Resize(1280, 720); const Font font(30); // OpenSiv3Dにはポリゴンクラスが用意されているので多角形を作れます。
You can’t perform that action at this time.