mirror of
https://github.com/Torrididdle/Arcle.git
synced 2026-05-27 00:03:44 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9cedf9a825 | |||
| 054e108433 | |||
| 653d71be4f |
Binary file not shown.
+1
-1
File diff suppressed because one or more lines are too long
+39
-5
@@ -8,7 +8,7 @@ _kernel_swi_regs outreg;
|
||||
|
||||
// Hard coded - must match file sizes (or be greater).
|
||||
char answers[11545];
|
||||
char dict[64735];
|
||||
char dict[64870];
|
||||
|
||||
// Should be enough (famous last words)
|
||||
char textbuffer[16];
|
||||
@@ -217,6 +217,26 @@ void screen_clear()
|
||||
_kernel_swi(OS_WriteC,&inreg,&outreg);
|
||||
}
|
||||
|
||||
int get_days_since_1jan1900()
|
||||
{
|
||||
char datebuffer[5];
|
||||
unsigned int date;
|
||||
|
||||
// Get centiseconds since 1 Jan 1900
|
||||
datebuffer[0] = 3;
|
||||
inreg.r[0] = 14;
|
||||
inreg.r[1] = (int)datebuffer;
|
||||
_kernel_swi(OS_Word,&inreg,&outreg);
|
||||
|
||||
// Drop a byte to get centiseconds/255 (so we can store in uint32)
|
||||
date = datebuffer[1] + (datebuffer[2] << 8) + (datebuffer[3] << 16) + (datebuffer[4] << 24);
|
||||
|
||||
// Turn into days (there are 33750 255th-centiseconds in a day)
|
||||
date = date / 33750;
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int font = 0;
|
||||
@@ -236,8 +256,20 @@ int main(int argc, char *argv[])
|
||||
loaddict("dict");
|
||||
printf("Loading answers...\n");
|
||||
loadanswers("answers");
|
||||
printf("Loading number...\n");
|
||||
loadarclenum("arcnum");
|
||||
|
||||
// Start 19th of June 2021 with 0
|
||||
arclenum = get_days_since_1jan1900() - 44364;
|
||||
|
||||
// In case we have gone past Oct 2027 we can just loop
|
||||
while(arclenum > 2309)
|
||||
arclenum = arclenum - 2309;
|
||||
|
||||
// If we pre-date wordle (perhaps clock not set) go with what's on file
|
||||
if(arclenum < 0)
|
||||
{
|
||||
printf("Loading number...\n");
|
||||
loadarclenum("arcnum");
|
||||
}
|
||||
|
||||
screen_clear();
|
||||
|
||||
@@ -366,6 +398,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
boxcolour = 0x1EAEFC00;
|
||||
usedguess[i] = 1;
|
||||
i = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -387,10 +420,11 @@ int main(int argc, char *argv[])
|
||||
memset (guess,'\0',sizeof(guess));
|
||||
guesslength = 0;
|
||||
guessnum++;
|
||||
if(greens >= 5)
|
||||
finished = 1;
|
||||
|
||||
if(guessnum >= 6)
|
||||
finished = 2;
|
||||
if(greens >= 5)
|
||||
finished = 1;
|
||||
greens = 0;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -3,4 +3,4 @@ An implementation of Wordle for the Acorn Archimedes series.
|
||||
|
||||
Done using SWI calls as a challenge. Code is pretty messy, Sunday afternoon job and a hack-together from some old RiscOS stuff I've done.
|
||||
|
||||
Starts at the very first wordle, will move forwards as you get them right. No date handling etc yet.
|
||||
Attempts to find the right word from the system clock. If the clock is un-set or pre-dates the first word then it starts at the beginning (or the one after the last one you've completed if appropriate).
|
||||
|
||||
Reference in New Issue
Block a user