-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #300 from polystat/char
char v1
- Loading branch information
Showing
25 changed files
with
238 additions
and
30 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "stdio.h" | ||
int main() { | ||
for (int i = 0; i < 1; i++) | ||
printf("%d\n", i); | ||
for (int i = 0; i < 1; i++) | ||
printf("%d\n", i); | ||
for (int i = 0; i < 1; i++) | ||
printf("%d\n", i); | ||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#include "stdio.h" | ||
char c = 5; | ||
unsigned char uc = 5; | ||
int main() { | ||
char lc = 5; | ||
unsigned char ulc = 5; | ||
|
||
printf("%d\n", c); | ||
printf("%d\n", uc); | ||
printf("%d\n", lc); | ||
printf("%d\n", ulc); | ||
|
||
c++; | ||
uc++; | ||
lc++; | ||
ulc++; | ||
|
||
printf("%d\n", c); | ||
printf("%d\n", uc); | ||
printf("%d\n", lc); | ||
printf("%d\n", ulc); | ||
|
||
c--; | ||
uc--; | ||
lc--; | ||
ulc--; | ||
|
||
printf("%d\n", c); | ||
printf("%d\n", uc); | ||
printf("%d\n", lc); | ||
printf("%d\n", ulc); | ||
|
||
c += 1000; | ||
uc += 1000; | ||
lc += 1000; | ||
ulc += 1000; | ||
|
||
printf("%d\n", c); | ||
printf("%d\n", uc); | ||
printf("%d\n", lc); | ||
printf("%d\n", ulc); | ||
|
||
c -= 2000; | ||
uc -= 2000; | ||
lc -= 2000; | ||
ulc -= 2000; | ||
|
||
printf("%d\n", c); | ||
printf("%d\n", uc); | ||
printf("%d\n", lc); | ||
printf("%d\n", ulc); | ||
|
||
// printf("%c\n", c); | ||
// printf("%c\n", uc); | ||
// printf("%c\n", lc); | ||
// printf("%c\n", ulc); | ||
|
||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "stdio.h" | ||
char c[] = {3, 4, 5, 6, 7, 8, 9}; | ||
char str[] = "hell"; | ||
char str2[] = {'h', 1, 2, 3, 'k'}; | ||
unsigned char str3[] = {'h', -1, -2, 3, 'k'}; | ||
int main() { | ||
for (int i = 0; i < 8; i++) | ||
printf("%d\n", c[i]); | ||
for (int i = 0; i < 5; i++) | ||
printf("%d\n", str[i]); | ||
for (int j = 0; j < 5; j++) | ||
printf("%d\n", str2[j]); | ||
for (int j = 0; j < 5; j++) | ||
printf("%d\n", str3[j]); | ||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
+alias org.eolang.math.number | ||
|
||
+package c2eo.coperators | ||
|
||
[a] > as-int8 | ||
(number a).as-int > value! | ||
if. > @ | ||
(value.as-bytes.slice 7 1).as-int.gte 0 | ||
(00-00-00-00-00-00-00.concat (value.as-bytes.slice 7 1)).as-int | ||
(FF-FF-FF-FF-FF-FF-FF.concat (value.as-bytes.slice 7 1)).as-int |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
+alias org.eolang.math.number | ||
|
||
+package c2eo.coperators | ||
|
||
[a] > as-uint8 | ||
(00-00-00-00-00-00-00.concat ((number a).as-int.as-bytes.slice 7 1)).as-int > @ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
+alias c2eo.coperators.read-as-int8 | ||
+alias c2eo.coperators.write-as-int8 | ||
|
||
+package c2eo.coperators | ||
|
||
[a] > post-dec-int8 | ||
seq > @ | ||
write-as-int8 a ((read-as-int8 a).minus 1) | ||
(read-as-int8 a).plus 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
+alias c2eo.coperators.read-as-uint8 | ||
+alias c2eo.coperators.write-as-uint8 | ||
|
||
+package c2eo.coperators | ||
|
||
[a] > post-dec-uint8 | ||
seq > @ | ||
write-as-uint8 a ((read-as-uint8 a).minus 1) | ||
(read-as-uint8 a).plus 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
+alias c2eo.coperators.read-as-int8 | ||
+alias c2eo.coperators.write-as-int8 | ||
|
||
+package c2eo.coperators | ||
|
||
[a] > post-inc-int8 | ||
seq > @ | ||
write-as-int8 a ((read-as-int8 a).plus 1) | ||
(read-as-int8 a).minus 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
+alias c2eo.coperators.read-as-uint8 | ||
+alias c2eo.coperators.write-as-uint8 | ||
|
||
+package c2eo.coperators | ||
|
||
[a] > post-inc-uint8 | ||
seq > @ | ||
write-as-uint8 a ((read-as-uint8 a).plus 1) | ||
(read-as-uint8 a).minus 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
+alias c2eo.coperators.read-as-int8 | ||
+alias c2eo.coperators.write-as-int8 | ||
|
||
+package c2eo.coperators | ||
|
||
[a] > pre-dec-int8 | ||
write-as-int8 a ((read-as-int8 a).minus 1) > @ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
+alias c2eo.coperators.read-as-uint8 | ||
+alias c2eo.coperators.write-as-uint8 | ||
|
||
+package c2eo.coperators | ||
|
||
[a] > pre-dec-uint8 | ||
write-as-uint8 a ((read-as-uint8 a).minus 1) > @ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
+alias c2eo.coperators.read-as-int8 | ||
+alias c2eo.coperators.write-as-int8 | ||
|
||
+package c2eo.coperators | ||
|
||
[a] > pre-inc-int8 | ||
write-as-int8 a ((read-as-int8 a).plus 1) > @ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
+alias c2eo.coperators.read-as-uint8 | ||
+alias c2eo.coperators.write-as-uint8 | ||
|
||
+package c2eo.coperators | ||
|
||
[a] > pre-inc-uint8 | ||
write-as-uint8 a ((read-as-uint8 a).plus 1) > @ |
Oops, something went wrong.
7dc91d1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to retrieve PDD puzzles from the code base and submit them to github. If you think that it's a bug on our side, please submit it to yegor256/0pdd:
Please, copy and paste this stack trace to GitHub: