All Countries by Latitude and Longitude Coordinates
Blog by
Last updated: Sunday September 26th, 2021
Report this blog
Last updated: Sunday September 26th, 2021
Report this blog
+1
I am currently working on a quiz in which the user enters a set of longitude and latitude co-ordinates into the answer box to fill in a country. For example, typing in 53°N, 2°W would fill in the UK, as these are the co-ordinates of a point in the UK (near Cheadle, Staffordshire). "53n2w" would of course also be accepted as spaces, punctuation and capitalisation are never required on Jetpunk. Only integer co-ordinates would be allowed, so the user would not type in "48.8582°N, 2.2949°E". Countries that contain no integer points can be filled in by typing the letter "Z".
Making this quiz is obviously time-consuming, and I am currently only a small percentage of the way through making it. I am adding type-ins by going down from the 89th parallel north to the 89th parallel south, and I have just finished the 68th parallel north. I expect to be sped up slightly as a result of having read this article, but realistically I will not be spending much time on it and I think it could potentially take around a year.
Here are some examples of lines of Regex I have written for the type-ins on this quiz:
^(80N(100|0?((7(1|2|3|4|5|6|7|8|9))|(8(0|1|2|3|4|5|6|8|9))|(9(0|1|2|3|4|5|6|9))))W)|(70N((0?((6(7|8|9))|(7(0|1|2|3|4|5|6|7|9))|(8(0|2|3|4))|(9(3|4|5|6)))|(1((0(1|2|3|4|5|6|7|8|9))|(1(0|1|2|3|4|5|6|7))|(2(5|7|8))|30|31))))W) (this is all one line!)
^(78N100E)|(68N(((0?(29|3[0-9]|4[56]|[5689][0-9]|7[0-3]|7[5-9]))|1([0-7][0-9]|80))E)|1(7[89]|80)W)
The first of these lines was written before I had read the previously referenced post; the second was written afterwards and I consider it to be much more efficient. UPDATE: After a longer period of time than I had expected, the quiz is now live: CLICK HERE
Making this quiz is obviously time-consuming, and I am currently only a small percentage of the way through making it. I am adding type-ins by going down from the 89th parallel north to the 89th parallel south, and I have just finished the 68th parallel north. I expect to be sped up slightly as a result of having read this article, but realistically I will not be spending much time on it and I think it could potentially take around a year.
Here are some examples of lines of Regex I have written for the type-ins on this quiz:
^(80N(100|0?((7(1|2|3|4|5|6|7|8|9))|(8(0|1|2|3|4|5|6|8|9))|(9(0|1|2|3|4|5|6|9))))W)|(70N((0?((6(7|8|9))|(7(0|1|2|3|4|5|6|7|9))|(8(0|2|3|4))|(9(3|4|5|6)))|(1((0(1|2|3|4|5|6|7|8|9))|(1(0|1|2|3|4|5|6|7))|(2(5|7|8))|30|31))))W) (this is all one line!)
^(78N100E)|(68N(((0?(29|3[0-9]|4[56]|[5689][0-9]|7[0-3]|7[5-9]))|1([0-7][0-9]|80))E)|1(7[89]|80)W)
The first of these lines was written before I had read the previously referenced post; the second was written afterwards and I consider it to be much more efficient. UPDATE: After a longer period of time than I had expected, the quiz is now live: CLICK HERE