If you wanted to optimize it some, you could get the first letter in, say, A, then RESTORE 1000+10*A so you only have to search through words with the same first letter.
[EDIT]
Looking at the code, you'd be much better off just having each country on a single line:
100 DATA "Afghanistan", "Agfa Albion", 13, 10
101 DATA "Algeria", "Algerton", 11, 14
Then you wouldn't need to loop at all.
You could just RESTORE 100+country: READ a$,b$,x,y
Capital Cities Tester
Re: Capital Cities Tester
Oh that's much better, and a good way of allowing alternative strings for "St" and "Saint" etc. Cheers!Kweepa wrote: ↑Sun May 06, 2018 10:55 pm Looking at the code, you'd be much better off just having each country on a single line:
100 DATA "Afghanistan", "Agfa Albion", 13, 10
101 DATA "Algeria", "Algerton", 11, 14
Then you wouldn't need to loop at all.
You could just RESTORE 100+country: READ a$,b$,x,y
I might even be charitable and give "ULAANBAATAR" alternatives, AFAIK this is correct spelling, but a lot of people expect the anglicised "ULAN BATOR".
Re: Capital Cities Tester
I've made some improvements thanks to suggestions from Kweepa, which have allowed more scope for alternative spellings (Washington DC/Washington D.C., Nay Pyi Taw/Naypyidaw...). It will now find every country very quickly and the same speed regardless of the first letter, I'm actually embarrassed my first attempt had such an appalling way of READing the data
And I've added Northern Ireland!
I seem to be floating around the 45% mark, I permanently walk round in the hope that someone will randomly ask me what the capital of Burkina Faso is.
As the next update will be next week, DOWNLOAD here for now.
And I've added Northern Ireland!
I seem to be floating around the 45% mark, I permanently walk round in the hope that someone will randomly ask me what the capital of Burkina Faso is.
Spoiler
Ouagadougou!
- MatGubbins
- Dynamite Dan
- Posts: 1239
- Joined: Mon Nov 13, 2017 11:45 am
- Location: Kent, UK
Re: Capital Cities Tester
Very nice and a lot faster. I'm still a plank.
Just a very small request.... Can we have a Currah Microspeech version that asks the questions, and speaks the answers and pronounces them correctly?
Just a very small request.... Can we have a Currah Microspeech version that asks the questions, and speaks the answers and pronounces them correctly?
Re: Capital Cities Tester
That is a brilliant idea. I only used currah in a couple of games and have never developed with it, I assume it's possible here.MatGubbins wrote: ↑Thu May 17, 2018 11:48 pm Can we have a Currah Microspeech version that asks the questions, and speaks the answers and pronounces them correctly?
Re: Capital Cities Tester
Good shout, it's always nicer to be called a buffoon via the spoken (rather than written) word...
My Speccy site: thirdharmoniser.com
- MatGubbins
- Dynamite Dan
- Posts: 1239
- Joined: Mon Nov 13, 2017 11:45 am
- Location: Kent, UK
Re: Capital Cities Tester
Currah only works with 48k Spectrums.
PAUSE 1 is your friend.
PAUSE 1 is your friend.
Re: Capital Cities Tester
Is it really not possible to get the Microspeech to work with 128K machines? I might be remembering this wrong but I thought it just replaced the standard BASIC interrupt routine and paged in its own ROM at address 56, which output the contents of a buffer at the top of memory. So what if this routine was somehow bypassed and instead the allophones were just output directly to the hardware?
I suppose the problem would be how to page in the ROM to get at the allophone table without needing the interrupt routine to be running. On the +3 you can have RAM where the ROM normally is, so would that help?
I suppose the problem would be how to page in the ROM to get at the allophone table without needing the interrupt routine to be running. On the +3 you can have RAM where the ROM normally is, so would that help?