0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

俺言語 その28

Posted at

概要

俺言語をやってみた。
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

成果物

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?