Skip to content

Instantly share code, notes, and snippets.

View marionette-of-u's full-sized avatar

arithmeticae marionette-of-u

View GitHub Profile
/*
----class/struct
dot
1ドットを表す構造体
b1u_t b; //blue
b1u_t g; //green
b1u_t r; //red
b1u_t a; //alpha
logic_error
#include <algorithm>
#include <vector>
#include <map>
template<
class Key,
class Mapped,
class Compare = std::less<Key>,
class Alloc = std::allocator<std::pair<Key, Mapped>>
> class vector_map{
@marionette-of-u
marionette-of-u / geoexplore.cs
Created December 3, 2015 09:48
旧geocitiesの生きているサイトを探します。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using System.IO;
using System.Windows.Forms;
namespace GeocitiesExplore
@marionette-of-u
marionette-of-u / input.txt
Last active November 3, 2015 06:37
lexer & parser (lxq)
<lexer> lexer{
mul = "\*";
div = "\/";
add = "\+";
sub = "\-";
left_paren = "\(";
right_paren = "\)";
[make_id] id = "[0-9]+";
}
#ifndef LEXER_HPP_
#define LEXER_HPP_
#include <vector>
#include <utility>
#include <exception>
namespace lexer{
enum class token_kind{
IF,
@marionette-of-u
marionette-of-u / grammar.txt
Created October 21, 2015 11:30
lexerに転用するためのautomatonです。正規表現からNFA、NFAからDFA、DFAから最小DFAへの変換が終わりました。
%token charactor<node*> vertical_bar dot asterisk plus question l_bracket r_bracket l_paren r_paren concat hyphen;
%namespace regex_parser;
S<node*>
: [make_identity] LevelC(0)
;
LevelC<node*>
: [make_or] LevelB(0) vertical_bar LevelC(1)
| [make_concat] LevelB(0) LevelC(1)
#define _USE_MATH_DEFINES
#include <memory>
#include <complex>
#include <iostream>
#include <cmath>
#include "bmp.hpp"
using complex_t = std::complex<float>;
int bit_rev(int a){
@marionette-of-u
marionette-of-u / main.cpp
Last active September 17, 2015 02:43
template tasklist.
#include "tasklist.hpp"
#include <iostream>
#include <string>
template<class T>
T *create_task();
tasklist::storage *delete_task(tasklist::arstorage);
struct a0 : public tasklist::task{
@marionette-of-u
marionette-of-u / tasksystem.hpp
Created August 20, 2015 03:18
7年前にVC++2008で書いたtemplateベースの(OS系ではなくてゲーム技術系での)タスクシステム。もちろん現行の環境ではコンパイルエラー
/*
軽量級タスクシステム
gccだと動かぬ
使い方は一番最後にあるよ
*/
#ifndef __TTY_TASKSYSTEM__
#define __TTY_TASKSYSTEM__
#include <boost/preprocessor/repetition/repeat.hpp>
= Tutorial 1
- さて、魔導書の取り扱いは初めてでしたね。
- まずは魔導書とスペルの関係について説明しましょう。
- 魔導書とは、魔力が充填されたスペル・ルールの書いてある書物です。
- プレイヤーは魔導書を開き、そこに書かれているルールに従ってスペルを唱えることで
- 魔法を発動させ、様々な効果を得ることができます。
- スペルを唱えると、そのスペルに応じた分だけプレイヤーの魔力と魔導書の魔力が
- 消費されます。