All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > General
One-liners (Posted on 2015-09-09) Difficulty: 3 of 5
a. (easy) What is the only U.S. state name that can be typed on a single row of keys on a standard QWERTY typewriter?

b. (harder) What are the countries,which names can be typed like in a.

c. (difficult) Same for capitals (of countries and US states).

See The Solution Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
oh, yes; forgot this | Comment 2 of 4 |
(In reply to mostly computer solution by Charlie)

pierre, south dakota


 Open "us states and capitals.csv" For Input As #1
 Do
   Line Input #1, l$
   l = LTrim(RTrim(LCase(l)))
   ls$ = l
   ix = InStr(l, ",")
   If ix Then state$ = Left(l, ix - 1): l = Mid(l, ix + 1)
   ix = InStr(l, ",")
   If ix Then l = Mid(l, ix + 1)
   ix = InStr(l, ",")
   If ix Then l = Mid(l, ix + 1)
   ix = InStr(l, ",")
   If ix Then l = Left(l, ix - 1)
   
   If Len(l) > 1 Then
     good1 = 1
     For i = 1 To Len(l)
       If InStr("qwertyuiop", Mid(l, i, 1)) = 0 Then good1 = 0: Exit For
     Next
     good2 = 1
     For i = 1 To Len(l)
       If InStr("asdfghjkl", Mid(l, i, 1)) = 0 Then good2 = 0: Exit For
     Next
     good3 = 1
     For i = 1 To Len(l)
       If InStr("zxcvbnm", Mid(l, i, 1)) = 0 Then good3 = 0: Exit For
     Next
     If good1 Or good2 Or good3 Then
       Text1.Text = Text1.Text & l & ", " & state & crlf
     End If
   End If
 
 Loop Until EOF(1)
 Close


  Posted by Charlie on 2015-09-09 20:01:53
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information