aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--yhtz.c (renamed from ytz.c)14
2 files changed, 8 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index b4fd173..cfe591b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,2 @@
debug:
- cc -g ytz.c
+ cc -g -o yhtz yhtz.c
diff --git a/ytz.c b/yhtz.c
index 6b8968b..cf556db 100644
--- a/ytz.c
+++ b/yhtz.c
@@ -18,7 +18,7 @@ typedef struct {
uint8_t botscore;
uint16_t dice;
uint16_t seed;
-} ytz_state;
+} yhtz_state;
/* ROLLS */
#define GET_ROLL(s) ((uint8_t)((s & 0xC0) >> 6)) /* top 2 bits */
@@ -83,7 +83,7 @@ uint16_t roll_die(uint16_t* seed) {
return (m >> 16) + 1; /* we ultimately want [1,7) */
}
-void print_dice(ytz_state* state) {
+void print_dice(yhtz_state* state) {
char* label = "die %d ";
char* top = ",---,";
char* mid = "| %d | ";
@@ -97,7 +97,7 @@ void print_dice(ytz_state* state) {
printf("\n%s %s %s %s %s\n", bot, bot, bot, bot, bot);
}
-void ask_for_rerolls(ytz_state* state) {
+void ask_for_rerolls(yhtz_state* state) {
char buf[10];
printf("which dice should be re-rolled? ");
fgets(buf, sizeof(buf), stdin);
@@ -112,7 +112,7 @@ void ask_for_rerolls(ytz_state* state) {
}
}
-void do_turn(ytz_state* state) {
+void do_turn(yhtz_state* state) {
int roll = GET_ROLL(state->topflag_w_roll);
bool reset = false;
@@ -130,7 +130,7 @@ void do_turn(ytz_state* state) {
state->topflag_w_roll = SET_ROLL(state->topflag_w_roll, ++roll);
}
-void init_ytz_state(ytz_state* state) {
+void init_yhtz_state(yhtz_state* state) {
state->topflag_w_roll = 0;
state->topscore = 0;
state->botflag = 0;
@@ -140,8 +140,8 @@ void init_ytz_state(ytz_state* state) {
}
void main() {
- ytz_state y;
- init_ytz_state(&y);
+ yhtz_state y;
+ init_yhtz_state(&y);
/*
* until the win condition is met