This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str = gets | |
for i in 0..len(str)-1 | |
puts "str[", i, "] = " + str[i] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fibo x | |
if x < 2 | |
1 | |
else | |
fibo(x - 1) + fibo(x - 2) | |
end | |
end | |
puts fibo 40 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 数字の表示 | |
# Hello world したいところですが、文字列が使えない... | |
print 43 | |
print 123456789 # 32bit 符号付き整数のみ対応 | |
# 変数と計算 | |
# 英文字で始まれば変数です。宣言は必要ありません。 | |
var = 12 | |
i = 43 | |
var = i + var * (12 / 5) # 小数が使えないので、12/5=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcc hello.c -o hello (または clang hello.c -o hello) | |
./hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int fibo(int x) | |
{ | |
if(x < 2) | |
return 1; | |
else | |
return fibo(x - 2) + fibo(x - 1); | |
} | |
int main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdio> | |
#include <ctime> | |
#include <cstring> | |
#include <cstdlib> | |
#include <cmath> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netdb.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Interpreter "CON" | |
Using: | |
fizzbuzz.a : | |
i = 0 | |
:loop | |
if i < 40 | |
if i % 15 == 0 | |
print "FizzBuzz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |