Skip to content

Instantly share code, notes, and snippets.

dev001hajipro

  • Japan
Block or report user

Report or block dev001hajipro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View arithmetic_progression.py
# a initial term
# d common_difference
def arithmetic_progression(a = 0, d = 0, n = 1):
print(a + (d * (n-1)))
return a + (d * (n-1))
def main():
nnn = [arithmetic_progression(5, 2, i) for i in range(1,10)]
print(nnn)
@dev001hajipro
dev001hajipro / Mux8Way16.hdl
Created Dec 23, 2018
nand2tetris Mux8Way16.hdl
View Mux8Way16.hdl
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/01/Mux8Way16.hdl
/**
* 8-way 16-bit multiplexor:
* out = a if sel == 000
* b if sel == 001
* etc.
View p5.js_snakegame.js
// https://www.youtube.com/watch?v=AaGK-fj-BAM
const scale = 20;
class Snake {
constructor() {
this.x = 0;
this.y = 0;
this.xspeed = 1;
this.yspeed = 0;
this.total = 0;
this.tail = [];
@dev001hajipro
dev001hajipro / Windows10_Racket_Install_tips_MEMO.md
Last active Oct 18, 2018
Windows10_Racket_Install_tips (tls1.2 support)
View Windows10_Racket_Install_tips_MEMO.md

racketのビルド

Tutorial: Contributing to Racket には、 main-distributionのビルド方法も書かれています。DrRacketIDEなどをビルドする時の参考になります。

環境

  • Windows10 64bit
  • Build Tools for Visual Studio

この例ではC:\workspace_racketで作業します。

View app.js
const rnd = (n = 4) => Math.floor(Math.random() * n)
class GameScene extends Phaser.Scene {
constructor() {
super({ key: 'gameScene' });
this.rows = 4;
this.cols = 4;
this.grid = new Array(4);
for (let r = 0; r < this.rows; r++) {
this.grid[r] = new Array(4);
@dev001hajipro
dev001hajipro / Makefile
Created Aug 5, 2018
複数ターゲットに対応したNASM32bitのMakefile
View Makefile
AS=nasm
#ASFLAGS=-f elf64 -g
ASFLAGS=-f elf -g
#LDFLAGS=
LDFLAGS=-m elf_i386
LD=ld
SOURCES=$(wildcard *.asm)
OBJECTS=$(SOURCES:.asm=.o)
TARGETS=$(SOURCES:.asm=)
@dev001hajipro
dev001hajipro / typinggame.py
Created Jul 13, 2018
Python3+Pygame typing game
View typinggame.py
# -*- coding: utf-8 -*-
""" タイピングゲーム """
import random
import sys
import pygame
def select_word():
@dev001hajipro
dev001hajipro / main.go
Last active Jun 28, 2018 — forked from yomusu/csvblob.go
Go appengine : csv upload(blob) & parse. 2018/06/28 change import to "context" and "google.golang.org/appengine/*"
View main.go
package main
import (
"context"
"html/template"
"io"
"net/http"
"encoding/csv"
"strings"
View sketch.js
function setup() {
createCanvas(500, 500);
colorMode(HSB, 255);
}
function draw() {
background(0, 50, 50);
var t = frameCount / 5;
var t2 = frameCount / 2;
@dev001hajipro
dev001hajipro / sketch.js
Last active May 15, 2018
円をつなぐ線 p5.js
View sketch.js
// https://stackoverflow.com/questions/4856717/javascript-equivalent-of-pythons-zip-function
// ex:
// zip([[1,2,3],['a','b','c']])
// [[1,'a'],[2, 'b'], [3, 'c']]
const zip = rows => rows[0].map((_, c) => rows.map(row => row[c]));
function makeCirclePoints(degs, t, offsetX, offsetY) {
return degs.map(deg => ({
"x": cos(radians(deg + t)) * 50 + offsetX,
"y": sin(radians(deg + t)) * 50 + offsetY,
You can’t perform that action at this time.