Skip to content

Commit e414f28

Browse files
committed
RELEASE 0.4.2
1 parent cf70563 commit e414f28

File tree

1 file changed

+40
-23
lines changed

1 file changed

+40
-23
lines changed

piskworks.c

+40-23
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ static int difficulty = 3;
7676
static int eagerness = 2;
7777

7878

79+
static void print_dedication();
7980
static void setup_preferences();
8081
static int get_option(char *message, char *values);
8182
static void get_input();
@@ -107,8 +108,11 @@ int main(int argc, char **argv) {
107108
score_player = 0;
108109

109110
printf("*******************\n");
110-
printf("* Piskworks %s *\n", VERSION);
111-
printf("*******************\n\n");
111+
printf("* Piskvorky %s *\n", VERSION);
112+
printf("*******************\n");
113+
printf("(c)2016 berk\n\n");
114+
print_dedication();
115+
112116
do {
113117
setup_preferences();
114118
eagerness = ((rand() % 3) - 1) * 2;
@@ -137,36 +141,49 @@ int main(int argc, char **argv) {
137141

138142
} while (result == 0);
139143

140-
printf("GAME OVER!\n");
144+
printf("KONEC HRY\n");
141145
if (result == 1) {
142146
score_computer++;
143-
printf("Computer is winner\n");
147+
printf("Vyhral pocitac\n");
144148
} else {
145149
score_player++;
146-
printf("You are winner\n");
147-
}
148-
printf("(d=%d, e=%d, %s started)\n", difficulty, eagerness, (computer_starts_game) ? "computer" : "you");
150+
printf("Jsi vitez\n");
151+
}
149152

150-
printf("Computer:You %d:%d\n", score_computer, score_player);
151-
c = get_option("\nAnother game? (y/n)", "YyNn");
152-
} while (tolower(c) == 'y');
153+
printf("Pocitac:Ty %d:%d\n", score_computer, score_player);
154+
c = get_option("\nHrat znovu? (a/n)", "AaNn");
155+
} while (tolower(c) == 'a');
153156

154157
return 0;
155158
}
156159

160+
void print_dedication() {
161+
printf("Toto vydani piskvorku je\n");
162+
printf("venovano webu CS.SPECCY.CZ,\n");
163+
printf("ktery sbira ceskoslovenske hry\n");
164+
printf("pro zx81.\n\n");
165+
166+
printf("Pokud vite o nejake\n");
167+
printf("ceskoslovenske hre pro zx81,\n");
168+
printf("kontaktujte prosim autory webu.\n\n");
169+
170+
printf("Pokracujte libovolnou klavesou.\n\n");
171+
getchar();
172+
}
173+
157174
void setup_preferences() {
158175
int c;
159176

160-
printf("Preferences:\n\n");
161-
printf("* your stones ... %c\n", toupper(cross_char));
162-
printf("* difficulty ... %d\n", difficulty);
163-
printf("* %s will put first move\n", (computer_starts_game) ? "computer" : "you");
177+
printf("Nastaveni:\n\n");
178+
printf("* tve kameny ... %c\n", toupper(cross_char));
179+
printf("* obtiznost ... %d\n", difficulty);
180+
printf("* %s\n", (computer_starts_game) ? "pocitac zacina hru" : "ty zacinas hru");
164181

165-
c = get_option("\n(C)hange preferences,(S)tart", "CcSs");
182+
c = get_option("\n(Z)mena nastaveni,(S)tart", "ZzSs");
166183

167-
if (tolower(c) == 'c') {
184+
if (tolower(c) == 'z') {
168185

169-
c = get_option("Do you want to play with X or O?", "XxOo");
186+
c = get_option("Chces hrat X nebo O?", "XxOo");
170187
if (tolower(c) == 'x') {
171188
cross_char = 'x';
172189
circle_char = 'o';
@@ -175,11 +192,11 @@ void setup_preferences() {
175192
circle_char = 'x';
176193
}
177194

178-
c = get_option("Which difficulty (1,2,3)?", "123");
195+
c = get_option("Zvol obtiznost (1,2,3)?", "123");
179196
difficulty = c - '1' + 1;
180197

181-
c = get_option("Do you want to put first move (y/n)?", "YyNn");
182-
if (tolower(c) == 'y') {
198+
c = get_option("Chcs zacinat hru (a/n)?", "AaNn");
199+
if (tolower(c) == 'a') {
183200
computer_starts_game = 0;
184201
} else {
185202
computer_starts_game = 1;
@@ -210,7 +227,7 @@ void get_input() {
210227

211228
do {
212229
is_input_correct = 0;
213-
printf("Put your move. (for ex. B3)\n");
230+
printf("Zadej svuj tah. (napr. B3)\n");
214231
fgets(line, LINELEN - 1, stdin);
215232

216233
if (strlen(line) < 2)
@@ -226,7 +243,7 @@ void get_input() {
226243

227244
s = get_stone(gs.minx + (x - 'A'), gs.miny + y - 1);
228245
if (s != EMPTY) {
229-
printf("This field is already occupied\n");
246+
printf("Toto pole je uz obsazene\n");
230247
continue;
231248
}
232249

@@ -580,7 +597,7 @@ void print_grid() {
580597
int x, y;
581598
STONE stone;
582599

583-
printf("\nMove %d\n\n", move_cnt);
600+
printf("\nTah %d\n\n", move_cnt);
584601
printf(" ");
585602
#ifndef SCCZ80
586603
putchar(' ');

0 commit comments

Comments
 (0)