Skip to content

Instantly share code, notes, and snippets.

View maekawatoshiki's full-sized avatar
🙃
Pursuing a master's degree

uint256_t maekawatoshiki

🙃
Pursuing a master's degree
View GitHub Profile
str = gets
for i in 0..len(str)-1
puts "str[", i, "] = " + str[i]
end
def fibo x
if x < 2
1
else
fibo(x - 1) + fibo(x - 2)
end
end
puts fibo 40
@maekawatoshiki
maekawatoshiki / litm
Created September 14, 2015 12:14
The Lit Programming Language Manual.
# What's the Lit?
Lit is programming language.
Lit uses JIT(Just-in-Time) Compile, so very faster.
Also, remember is easy because Lit syntax is like Ruby' syntax.
**Copyright (C) 2015 maekawatoshiki All Rights Reserved.**
# How to use
@maekawatoshiki
maekawatoshiki / file0.txt
Last active September 9, 2015 00:44
JITコンパイラライクなものを作ってみた ref: http://qiita.com/maekawatoshiki/items/320465127ae569607ebf
# 数字の表示
# Hello world したいところですが、文字列が使えない...
print 43
print 123456789 # 32bit 符号付き整数のみ対応
# 変数と計算
# 英文字で始まれば変数です。宣言は必要ありません。
var = 12
i = 43
var = i + var * (12 / 5) # 小数が使えないので、12/5=2
gcc hello.c -o hello (または clang hello.c -o hello)
./hello
@maekawatoshiki
maekawatoshiki / file0.c
Created June 30, 2015 04:57
フィボナッチ数列をどこまで小さく記述できるか in C ref: http://qiita.com/maekawatoshiki/items/b1cba7600d3dbd634a79
#include <stdio.h>
int fibo(int x)
{
if(x < 2)
return 1;
else
return fibo(x - 2) + fibo(x - 1);
}
int main()
@maekawatoshiki
maekawatoshiki / ntp.cpp
Last active August 29, 2015 14:20
Ntp Clock
#include <iostream>
#include <cstdio>
#include <ctime>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
@maekawatoshiki
maekawatoshiki / con.cpp
Last active August 29, 2015 14:18
Interpreter "CON"
/*
Interpreter "CON"
Using:
fizzbuzz.a :
i = 0
:loop
if i < 40
if i % 15 == 0
print "FizzBuzz"
@maekawatoshiki
maekawatoshiki / likeeditor.cpp
Last active April 5, 2018 14:27
like editor
#include <iostream>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <termios.h>
#include <unistd.h>
using namespace std;
static struct termios t_orig;
void begin_getch(void)
@maekawatoshiki
maekawatoshiki / main.cpp
Last active August 29, 2015 14:17
NeuralNetworks_Weather
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <iostream>
#include <unistd.h>
using namespace std;
#define NUM_LEARN 80000000
#define NUM_SAMPLE 310
#define NUM_INPUT 3