Skip to content

Instantly share code, notes, and snippets.

View yashihei's full-sized avatar

Ryuhei Kobayashi yashihei

View GitHub Profile
@yashihei
yashihei / main.js
Last active December 22, 2015 14:08
/*
* ブロック崩し
* written by yashihei
*/
enchant();
//グローバル変数
var game = null;
//定数
#include <iostream>
using namespace std;
template <class T>
class Stack {
public:
static const int STACK_SIZE = 100;
Stack() {sp = 0;}
void push(const T&);
#include <iostream>
#include <chrono>
using namespace std;
int main()
{
auto begin = chrono::high_resolution_clock::now();
//計測したい処理
@yashihei
yashihei / loli.bat
Last active December 31, 2015 08:29
a.exe < 2014-yo-t%1-in1.txt > 2014-yo-t%1-out1.txt
a.exe < 2014-yo-t%1-in2.txt > 2014-yo-t%1-out2.txt
a.exe < 2014-yo-t%1-in3.txt > 2014-yo-t%1-out3.txt
a.exe < 2014-yo-t%1-in4.txt > 2014-yo-t%1-out4.txt
a.exe < 2014-yo-t%1-in5.txt > 2014-yo-t%1-out5.txt
@yashihei
yashihei / main.cpp
Last active January 2, 2016 05:49
オレオレ仕様Dxlibのmain.cpp
#include <Dxlib.h>
#pragma warning(disable:4996)
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow ) {
//SetGraphMode();画面サイズ任意
if (MessageBox(NULL,"フルスクリーンで起動しますか?","起動オプション",MB_YESNO) == IDYES) {
ChangeWindowMode(FALSE);
} else {
ChangeWindowMode(TRUE);
}
#include <Siv3D.hpp>
//色々だるいしシーケンスグローバル
enum class State {
TITLE,
IN_GAME,
GAMEOVER,
CLEAR,
};
#include <iostream>
#include <vector>
#include <random>
class Board {
public:
Board() {
//容量確保
dat.resize(9);
for (int i = 0; i < 9; i++) {
@yashihei
yashihei / tekunyans.cs
Created July 18, 2014 05:38
てくなんず
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@yashihei
yashihei / wasureta.md
Last active August 29, 2015 14:19
Gitで何回も忘れてggってるコマンドを書いておく場所

このファイル管理したくないのにcommitしてしまったって時

  • .gitignoreに対象のファイルを追加
  • git rm --cached [filename]

リモートリポジトリにあるコミットを打ち消し

  • revertで歴史を書き換える
  • ブランチぶっ飛ばして入れ替えるなんてしない

過去のコミットを書き換え

  • git commit --amendで直前のコミットを書き換え
@yashihei
yashihei / main.cpp
Last active August 29, 2015 14:21
danmaku_generator
#include <Siv3D.hpp>
#include <deque>
using namespace std;
class Bullet {
public:
Bullet(Vec2 pos, Vec2 vec, Color color): pos(pos), vec(vec), color(color) {}
void move() {
pos += vec;