Skip to content

Instantly share code, notes, and snippets.

View mosmos21's full-sized avatar
🏠

Takahito Hashimoto mosmos21

🏠
View GitHub Profile
@mosmos21
mosmos21 / use_nom.rs
Last active December 27, 2023 03:57
四則演算の実装
use nom::{
IResult,
character::complete::i32,
bytes::complete::tag,
branch::alt,
};
#[derive(Debug, PartialEq)]
enum Expr {
Term(Term),
@mosmos21
mosmos21 / brainfuck.rb
Last active September 25, 2019 23:32
$__="#"=~/$/;$_=$__-$__;$___=$__+$__;@_=$**'';@__=[$_]*($___**($___+$___+$__))
@___=$_;@____=->(_){@_[_]&&(@_[_]=='>'&&@___+=$__;@_[_]=='<'&&@___-=$__;@_[_]==
'+'&&@__[@___]+=$__;@_[_]=='-'&&@__[@___]-=$__;@_[_]=='.'&&$><<(""<<@__[@___])
@_[_]=='['&&@__[@___]==$_&&_=$____[_+$__,$__];@_[_]==']'&&@__[@___]!=$_&&_=
$_____[_-$__,$__];@____[_+$__])};$____=->(_,__){@_[_]==']'&&__-=$__;@_[_]==
'['&&__+=$__;__==$_?_:$____[_+$__,__]};$_____=->(_,__){@_[_]=='['&&__-=$__;@_[_
]==']'&&__+=$__;__==$_?_:$_____[_-$__,__]};@____[$_]
@mosmos21
mosmos21 / main.py
Last active January 28, 2019 00:17
# -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
from typing import TypeVar, Generic, Dict, List
class Target:
"""
ターゲットオブジェクト
"""
@mosmos21
mosmos21 / Try.java
Last active October 24, 2018 11:12
@FunctionalInterface
interface ThrowableFunction<T, R>{
R apply(T t) throws Throwable;
}
@FunctionalInterface
interface VoidFunction {
void apply(Throwable e);
}
######################################################################
### グローバルな変数
######################################################################
[bool]$DEBUG = $TRUE
[array]$MEMORY = @(0, 0, 0, 0, 0, 0)
[int]$MEMORY_FIRST = "A"[0]
######################################################################
### コマンド関連
######################################################################