俺言語 その28
概要
俺言語をやってみた。
xor,and,orを実装してみた。
xor
10 a=0
OK
20 b=0
OK
30 ?="0 0 "
OK
40 c=a^b
OK
50 ?=c
OK
60 ?=;
OK
70 a=1
OK
80 ?="1 0 "
OK
90 c=a^b
OK
100 ?=c
OK
110 ?=;
OK
120 a=0
OK
130 b=1
OK
140 ?="0 1 "
OK
150 c=a^b
OK
160 ?=c
OK
170 ?=;
OK
180 a=1
OK
190 ?="1 1 "
OK
200 c=a^b
OK
210 ?=c
OK
220 ?=;
OK
#=1
0 0 0
1 0 1
0 1 1
1 1 0
OK
and
10 a=0
OK
20 b=0
OK
30 ?="0 0 "
OK
40 c=a&b
OK
50 ?=c
OK
60 ?=;
OK
70 a=1
OK
80 ?="1 0 "
OK
90 c=a&b
OK
100 ?=c
OK
110 ?=;
OK
120 a=0
OK
130 b=1
OK
140 ?="0 1 "
OK
150 c=a&b
OK
160 ?=c
OK
170 ?=;
OK
180 a=1
OK
190 ?="1 1 "
OK
200 c=a&b
OK
210 ?=c
OK
220 ?=;
OK
#=1
0 0 0
1 0 0
0 1 0
1 1 1
OK
or
10 a=0
OK
20 b=0
OK
30 ?="0 0 "
OK
40 c=a|b
OK
50 ?=c
OK
60 ?=;
OK
70 a=1
OK
80 ?="1 0 "
OK
90 c=a|b
OK
100 ?=c
OK
110 ?=;
OK
120 a=0
OK
130 b=1
OK
140 ?="0 1 "
OK
150 c=a|b
OK
160 ?=c
OK
170 ?=;
OK
180 a=1
OK
190 ?="1 1 "
OK
200 c=a|b
OK
210 ?=c
OK
220 ?=;
OK
#=1
0 0 0
1 0 1
0 1 1
1 1 1
OK
成果物
10 a=0
OK
20 b=0
OK
30 ?="0 0 "
OK
40 c=a^b
OK
50 ?=c
OK
60 ?=;
OK
70 a=1
OK
80 ?="1 0 "
OK
90 c=a^b
OK
100 ?=c
OK
110 ?=;
OK
120 a=0
OK
130 b=1
OK
140 ?="0 1 "
OK
150 c=a^b
OK
160 ?=c
OK
170 ?=;
OK
180 a=1
OK
190 ?="1 1 "
OK
200 c=a^b
OK
210 ?=c
OK
220 ?=;
OK
#=1
0 0 0
1 0 1
0 1 1
1 1 0
OK
10 a=0
OK
20 b=0
OK
30 ?="0 0 "
OK
40 c=a&b
OK
50 ?=c
OK
60 ?=;
OK
70 a=1
OK
80 ?="1 0 "
OK
90 c=a&b
OK
100 ?=c
OK
110 ?=;
OK
120 a=0
OK
130 b=1
OK
140 ?="0 1 "
OK
150 c=a&b
OK
160 ?=c
OK
170 ?=;
OK
180 a=1
OK
190 ?="1 1 "
OK
200 c=a&b
OK
210 ?=c
OK
220 ?=;
OK
#=1
0 0 0
1 0 0
0 1 0
1 1 1
OK
or
10 a=0
OK
20 b=0
OK
30 ?="0 0 "
OK
40 c=a|b
OK
50 ?=c
OK
60 ?=;
OK
70 a=1
OK
80 ?="1 0 "
OK
90 c=a|b
OK
100 ?=c
OK
110 ?=;
OK
120 a=0
OK
130 b=1
OK
140 ?="0 1 "
OK
150 c=a|b
OK
160 ?=c
OK
170 ?=;
OK
180 a=1
OK
190 ?="1 1 "
OK
200 c=a|b
OK
210 ?=c
OK
220 ?=;
OK
#=1
0 0 0
1 0 1
0 1 1
1 1 1
OK
成果物
10 a=0
OK
20 b=0
OK
30 ?="0 0 "
OK
40 c=a|b
OK
50 ?=c
OK
60 ?=;
OK
70 a=1
OK
80 ?="1 0 "
OK
90 c=a|b
OK
100 ?=c
OK
110 ?=;
OK
120 a=0
OK
130 b=1
OK
140 ?="0 1 "
OK
150 c=a|b
OK
160 ?=c
OK
170 ?=;
OK
180 a=1
OK
190 ?="1 1 "
OK
200 c=a|b
OK
210 ?=c
OK
220 ?=;
OK
#=1
0 0 0
1 0 1
0 1 1
1 1 1
OK
以上。
Author And Source
この問題について(俺言語 その28), 我々は、より多くの情報をここで見つけました https://qiita.com/ohisama@github/items/7e67e6bd87b557b2cb93著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .