repo.or.cz
/
pachi
/
json.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
UCB1AMAF: Make rave_prior the default
[pachi/json.git]
/
stone.c
blob
96a45c1032f62f042a8ab3c5887a424239ed564b
1
#include <ctype.h>
2
#include <stdio.h>
3
#include <stdlib.h>
4
5
#include
"stone.h"
6
7
char
*
8
stone2str
(
enum
stone s
)
9
{
10
switch
(
s
) {
11
case
S_BLACK
:
return
"black"
;
12
case
S_WHITE
:
return
"white"
;
13
default
:
return
"none"
;
14
}
15
}
16
17
enum
stone
18
str2stone
(
char
*
str
)
19
{
20
switch
(
tolower
(*
str
)) {
21
case
'b'
:
return
S_BLACK
;
22
case
'w'
:
return
S_WHITE
;
23
default
:
return
S_NONE
;
24
}
25
}