RonriBoxをやってみた。

#概要

RonriBoxをやってみた。

#関数を作る。

##xor

```
({{$0}}) ^ ({{$1}})
```

##and

```
({{$0}}) & ({{$1}})
```

##or

```
({{$0}}) | ({{$1}})
```

#テストを書く。

##test_xor

```
{{yas/programWithIO(
	"",
	"",
	v-repeat("", "false",
            yas/ifelse(ohisama/xor("0","0"), yas/println(yas/strLiteral("true")), yas/println(yas/strLiteral("false"))),
            yas/ifelse(ohisama/xor("0","1"), yas/println(yas/strLiteral("true")), yas/println(yas/strLiteral("false"))),
            yas/ifelse(ohisama/xor("1","0"), yas/println(yas/strLiteral("true")), yas/println(yas/strLiteral("false"))),
            yas/ifelse(ohisama/xor("1","1"), yas/println(yas/strLiteral("true")), yas/println(yas/strLiteral("false")))
	),
	"test_xor"
)}}
```

##test_and

```
{{yas/programWithIO(
	"",
	"",
	v-repeat("", "false",
            yas/ifelse(ohisama/and("0","0"), yas/println(yas/strLiteral("false")), yas/println(yas/strLiteral("true"))),
            yas/ifelse(ohisama/and("0","1"), yas/println(yas/strLiteral("false")), yas/println(yas/strLiteral("true"))),
            yas/ifelse(ohisama/and("1","0"), yas/println(yas/strLiteral("false")), yas/println(yas/strLiteral("true"))),
            yas/ifelse(ohisama/and("1","1"), yas/println(yas/strLiteral("false")), yas/println(yas/strLiteral("true")))
	),
	"test_and"
)}}
```

##test_or

```
{{yas/programWithIO(
	"",
	"",
	v-repeat("", "false",
            yas/ifelse(ohisama/or("0","0"), yas/println(yas/strLiteral("false")), yas/println(yas/strLiteral("true"))),
            yas/ifelse(ohisama/or("0","1"), yas/println(yas/strLiteral("false")), yas/println(yas/strLiteral("true"))),
            yas/ifelse(ohisama/or("1","0"), yas/println(yas/strLiteral("false")), yas/println(yas/strLiteral("true"))),
            yas/ifelse(ohisama/or("1","1"), yas/println(yas/strLiteral("false")), yas/println(yas/strLiteral("true")))
	),
	"test_or"
)}}
```

#ｃを生成。

##{{ohisama/test_xor()}}

```
#include <stdio.h>




int main(int argc, char* args[])
{
   if((0) ^ (0) ) {
    puts("false");
} else {
    puts("true");
}
if((0) ^ (1) ) {
    puts("false");
} else {
    puts("true");
}
if((1) ^ (0) ) {
    puts("false");
} else {
    puts("true");
}
if((1) ^ (1) ) {
    puts("false");
} else {
    puts("true");
}
   return 0;
}
```

##{{ohisama/test_and()}}

```
#include <stdio.h>




int main(int argc, char* args[])
{
   if((0) & (0) ) {
    puts("false");
} else {
    puts("true");
}
if((0) & (1) ) {
    puts("false");
} else {
    puts("true");
}
if((1) & (0) ) {
    puts("false");
} else {
    puts("true");
}
if((1) & (1) ) {
    puts("false");
} else {
    puts("true");
}
   return 0;
}
```

##{{ohisama/test_or()}}

```
#include <stdio.h>




int main(int argc, char* args[])
{
   if((0) | (0) ) {
    puts("false");
} else {
    puts("true");
}
if((0) | (1) ) {
    puts("false");
} else {
    puts("true");
}
if((1) | (0) ) {
    puts("false");
} else {
    puts("true");
}
if((1) | (1) ) {
    puts("false");
} else {
    puts("true");
}
   return 0;
}
```

#paizaで実行。

test_xor
https://paiza.io/projects/iz3wA9YXHdQiYUllZQthKw
test_and
https://paiza.io/projects/rv3FAnrP2XnOP1-jqfuLTQ
test_or
https://paiza.io/projects/6LsFkrJbq0yf5WIKxyy33Q


以上。