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
@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 / SDL_Emscripten_pixel manipulation_SDL_LockTexture_SDL_MapRGBA
Last active Nov 13, 2019
pixel manipulation: SDL_LockTexture and SDL_MapRGBA sample on Emscripten.
View SDL_Emscripten_pixel manipulation_SDL_LockTexture_SDL_MapRGBA
pixel manipulation: SDL_LockTexture and SDL_MapRGBA sample on Emscripten.
# https://gamedev.stackexchange.com/questions/98641/how-do-i-modify-textures-in-sdl-with-direct-pixel-access
bellow code dont run.
SDL_PixelFormat pixelFormat;
pixelFormat.format = format;
# rewrite my code.
ctx->pixelFormat = SDL_AllocFormat(SDL_PIXELFORMAT_RGBA8888);
*p = SDL_MapRGBA(ctx->pixelFormat, 255, 0, 0, 255);
@dev001hajipro
dev001hajipro / build.bat
Created Apr 24, 2017
emscripten: draw pixels with SDL_UpdateTexture
View build.bat
emcc test_pixel.c ^
-O2 ^
-s USE_SDL=2 ^
-s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS="[""png""]" ^
-s USE_SDL_TTF=2 ^
--preload-file assets ^
-o test_pixel.html
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 / 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"
You can’t perform that action at this time.