Capital Cities Tester

People are still making stuff for the Sinclair related machines. Tell us about new games and other software that runs on the Spectrum, ZX80/ZX81, Pentagon and Next.
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Capital Cities Tester

Post by R-Tape »

ImageImage

Do you think Ouagadougou is the capital of Cardiff? If so then this utility is for YOU!

Capital Cities Tester

I made this after a chat with someone about pub quizzes and I realised how pig ignorant I was on the subject.

You can play a random or alphabet list quiz in which are you given a country, e.g Burkina Faso, and you input its capital city, in this case Ouagadougou. In the random game you will not be asked the same country twice in a row, so you will never have to input Ouagadougou once and then Ouagadougou immediately after.

There is some rudimentary string checking to give a bit of leeway with spelling (in retrospect - why did I put that in?!), so you would be allowed Ouagadougoo for example, but I’m not totally happy with it as it allows quite a few howlers, like PORIS.

Performance stats are kept and you get a report every 10 questions.

There might be a few cases where I've picked the wrong capital where is more than one, or one of a few possible choices of spelling, I'll wait and see if that crops up.
User avatar
Kweepa
Manic Miner
Posts: 311
Joined: Sat Feb 03, 2018 6:14 pm
Location: Albuquerque, New Mexico

Re: Capital Cities Tester

Post by Kweepa »

Oh god, I suck.
I am a "plank".
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: Capital Cities Tester

Post by R-Tape »

Kweepa wrote: Thu May 03, 2018 8:33 pm Oh god, I suck.
I am a "plank".
Keep trying, you might reach the giddy heights of "buffoon" like me.
User avatar
Morkin
Bugaboo
Posts: 3251
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: Capital Cities Tester

Post by Morkin »

Buffoon. Will take that. :D :D :D

Image

Only because Ireland came up 3 times.
My Speccy site: thirdharmoniser.com
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: Capital Cities Tester

Post by R-Tape »

Morkin wrote: Thu May 03, 2018 9:35 pm Buffoon. Will take that. :D :D :D
8-)
Only because Ireland came up 3 times.
Don't tell me, Ireland......Ouagadougou?
User avatar
MatGubbins
Dynamite Dan
Posts: 1238
Joined: Mon Nov 13, 2017 11:45 am
Location: Kent, UK

Re: Capital Cities Tester

Post by MatGubbins »

Needs an update to accept swearing when an answer is not known.

I'm a plank! Yay! 1 outta 11 -
I got Russia wrong.... it didn't accept Raid Over Moscow.

There could be a third type of game here, the country is given and the player moves the cursor around the map and presses fire when they think they've got the correct location.

Well done for this BASIC mind jogger.
User avatar
Alessandro
Dynamite Dan
Posts: 1908
Joined: Wed Nov 15, 2017 11:10 am
Location: Messina, Italy
Contact:

Re: Capital Cities Tester

Post by Alessandro »

Heh... First attempt 45% with 3/4 African states which capitals I didn't remember at all, except for Ethiopia (luckily the program accepted the Italian "Addis AbEba" spelling instead of "AbAba"). I knew the capital of Mozambique was called Lourenço Marques during the Portuguese domination and in the first years of independence but didn't remember it was later renamed Maputo.

Second attempt went better but the capital of Slovenia is "Lubiana" in Italian, which the program didn't accept, so that does not count as an error, as well as Dakha for Bangladesh which the program stores as "Dhaka". ;) Oddly enough, it asked for the capital of Vatican City, which is Vatican City itself, in fact. 16 out of 22.
User avatar
RMartins
Manic Miner
Posts: 776
Joined: Thu Nov 16, 2017 3:26 pm

Re: Capital Cities Tester

Post by RMartins »

Cool map, nice game.

What make s a ZX DB entry, provide access to online emulator links or not ?
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: Capital Cities Tester

Post by R-Tape »

MatGubbins wrote: Thu May 03, 2018 10:02 pm I'm a plank! Yay! 1 outta 11 -
There could be a third type of game here, the country is given and the player moves the cursor around the map and presses fire when they think they've got the correct location.

Well done for this BASIC mind jogger.
Plus a tiny bit of assembly to LDIR the screen, POKEd in from the BASIC. I like the 'point at the country' idea.
Alessandro wrote: Thu May 03, 2018 10:36 pm Heh... First attempt 45% with 3/4 African states which capitals I didn't remember at all, except for Ethiopia (luckily the program accepted the Italian "Addis AbEba" spelling instead of "AbAba"). I knew the capital of Mozambique was called Lourenço Marques during the Portuguese domination and in the first years of independence but didn't remember it was later renamed Maputo.

Second attempt went better but the capital of Slovenia is "Lubiana" in Italian, which the program didn't accept, so that does not count as an error, as well as Dakha for Bangladesh which the program stores as "Dhaka". ;) Oddly enough, it asked for the capital of Vatican City, which is Vatican City itself, in fact. 16 out of 22.
First dibs on Ale for my pub quiz team!

In its current form the program only allows one possibility per country. There are quite a few where I would have liked to include alternatives, Mongolia may prove contentious for example. I’m glad my simple string checks have helped out in a few cases though.

I removed some of the more obscure overseas territories but I left the Vatican in intentionally, it’s a bona fide country with Vatican City as its capital.
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: Capital Cities Tester

Post by R-Tape »

RMartins wrote: Fri May 04, 2018 9:23 am Cool map, nice game.

What make s a ZX DB entry, provide access to online emulator links or not ?
Cheers.

Don't know sorry, that's one for [mention]PeterJ[/mention]
User avatar
PeterJ
Site Admin
Posts: 6855
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Capital Cities Tester

Post by PeterJ »

Morning all, the online emulators work with tap, z80 and sna files.

Peter

PS. JSSpeccy apparently works with some tzx files, but that is undergoing testing currently by us.
Ralf
Rick Dangerous
Posts: 2279
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: Capital Cities Tester

Post by Ralf »

Nice!

Out of curiosity, what wast he source for your list of states and capitals? Did you include some really small states like Kiribati or Marshall Islands? And what about controversial states not accepted by everyone?
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: Capital Cities Tester

Post by R-Tape »

Ralf wrote: Fri May 04, 2018 10:51 am Out of curiosity, what wast he source for your list of states and capitals? Did you include some really small states like Kiribati or Marshall Islands? And what about controversial states not accepted by everyone?
I took this list, one of the first in a usable format thrown up by a google search.

So that ignores various 'areas of complexity' , Cyprus is only the Republic of, I added Palestine with Ramallah as de facto capital, I removed some of the smallest islands (possibly Marshall Island and Kiribati included). I can't remember all the details but in the cold light of day I'm worried I didn't give these decisions enough consideration.

Now, who *haven't* I pissed off?
User avatar
Juan F. Ramirez
Bugaboo
Posts: 5102
Joined: Tue Nov 14, 2017 6:55 am
Location: Málaga, Spain

Re: Capital Cities Tester

Post by Juan F. Ramirez »

At last, after 35 years, a program that help us with our homework!

*gets coat etc*
User avatar
Kweepa
Manic Miner
Posts: 311
Joined: Sat Feb 03, 2018 6:14 pm
Location: Albuquerque, New Mexico

Re: Capital Cities Tester

Post by Kweepa »

R-Tape wrote: Fri May 04, 2018 11:15 am I took this list
Spoilers!
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: Capital Cities Tester

Post by R-Tape »

Oh bloody hell! It's missing Northern Ireland :o

A fixed version will be in the next update :shock:
User avatar
Kweepa
Manic Miner
Posts: 311
Joined: Sat Feb 03, 2018 6:14 pm
Location: Albuquerque, New Mexico

Re: Capital Cities Tester

Post by Kweepa »

AAh, that's why I got 'plank' (I'm from the capital of NI)!
Everyone else was playing with an advantage.
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: Capital Cities Tester

Post by R-Tape »

I think you were the reason I remembered, norniron must have sprung to mind.

Dammit, I still need to add the rest of CGC 2013 files to the site, here it is for now.
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Capital Cities Tester

Post by Nomad »

How about historical states? But then that is a whole new can of worms. Like what do you do when a government is in a state of collapse like say Italy at the end of the second world war.. Or Manchukuo, that changed its capital twice and now is a non-existent state... :lol:
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: Capital Cities Tester

Post by R-Tape »

We could have a fantasy future version too, for example in John Wyndham's 'The Kraken Awakes' in which Harrogate becomes the capital when the undersea aliens melt the icecaps and flood London (or something like that).

The DATA string search is already too long for BASIC though. If you play the list game you'll notice it get gradually slower as it steps through the alphabet, by the time you're at Zimbabwe you can make a cup of tea* in the time it takes to find the string and print the yx cors. I'm too busy with other stuff but I did toy with the idea of a machine code version that included a summary of the country - population, currency etc and its flag.

*maybe not, but there's time enough to send a text while jiggling your legs.
User avatar
Kweepa
Manic Miner
Posts: 311
Joined: Sat Feb 03, 2018 6:14 pm
Location: Albuquerque, New Mexico

Re: Capital Cities Tester

Post by Kweepa »

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
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: Capital Cities Tester

Post by R-Tape »

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
Oh that's much better, and a good way of allowing alternative strings for "St" and "Saint" etc. Cheers!

I might even be charitable and give "ULAANBAATAR" alternatives, AFAIK this is correct spelling, but a lot of people expect the anglicised "ULAN BATOR".
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: Capital Cities Tester

Post by R-Tape »

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.
Spoiler
Ouagadougou!
As the next update will be next week, DOWNLOAD here for now.
User avatar
MatGubbins
Dynamite Dan
Posts: 1238
Joined: Mon Nov 13, 2017 11:45 am
Location: Kent, UK

Re: Capital Cities Tester

Post by MatGubbins »

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?
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: Capital Cities Tester

Post by R-Tape »

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?
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.
Post Reply