diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-09-13 23:38:59 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-09-13 23:38:59 +0300 |
commit | 87514fc685ea45241dbb00471388638e0be1b229 (patch) | |
tree | 38fbc12f1ad1aa982703b6af429a6c933f0c1f0d /src/main.c | |
parent | b8bb4d08ef489bc81e9c00ae43d19c3795e22072 (diff) | |
download | j1chess-87514fc685ea45241dbb00471388638e0be1b229.tar.gz |
feat: add notations
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1,9 +1,17 @@ #include "unittest.h" #include "board.h" +void test_notations() { + printf("%u\n", notation_to_index('e', 4)); + unit_test(notation_to_index('e', 4) == 28, "Notation e4 is index 28"); + + char notation[2] = "x0"; + index_to_notation(28, notation); + unit_test(notation[0] == 'e' && notation [1] == '4', "Index 28 is notation e4"); +} + int main() { - unit_test(2 * 2 == 4, "2 * 2 == 4"); - unit_test(2 * 2 == 5, "2 * 2 == 4"); + test_notations(); report(); return 0; |