VrrtepCLI

Started by Tirea Aean, May 22, 2011, 03:40:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

`Eylan Ayfalulukanä

Wou Wou Wou nang

What a way cool tool!

I have seen you post windows from this program is different places; now I know what it is.

I can't wait to read the whole thread, and then deploy it on all the machines I normally use (Two Linux (Fedora 14), one Window$ XP, one Window$ 7) But sadly, this will probably have to wait until the weekend.

Yawey ngahu!
pamrel si ro [email protected]

Blue Elf

Quote from: Tirea Aean on May 25, 2011, 03:46:03 PM
I'm not 100% sure what would be causing that issue. and this is ONLY for the scramble game? Linux had that problem before, but that was Python's fault and I fixed it. it was scrambling the components of ì and ä. (ì is actually \xc3\xac to python, two characters in one. and ä is \xc3\xa4)

as for the options, I can look into printing the local language translation of the currently scrambled word.

Actually, already, you are able to play the quiz game in both directions:
na'vi question, local language answers OR local language question, na'vi answers. you can play in any language. for example, try running:

(note that if you use the -l parameter with no language flag, -eng is the default)

vrrtepcli -l -q (english questions, na'vi answers)

vrrtepcli -de -q (na'vi questions, german answers)

this is all in the README
Great! But help doesn't say anything about -q switch. Readme is ok (unfortunately, it is not read earlier than everything goes wrong way :))

I tried to set default locale for nonUnicode progs to English/USA. Now everything seems to be printed Ok, but problem with entering reply persists. It seems to be problem when reading keyboard inside program, reading from console works:
C:\Documents and Settings\Administrator>vrrtepcli -n nìn

C:\Documents and Settings\Administrator>echo off
Vrrtep CLI v1.9 by Tirea Aean. run 'vrrtepcli -h' for usage.
Windows version by Swoka Ikran
Standalone version

vtr. look at


C:\Documents and Settings\Administrator>vrrtepcli -n 'ärìp

C:\Documents and Settings\Administrator>echo off
Vrrtep CLI v1.9 by Tirea Aean. run 'vrrtepcli -h' for usage.
Windows version by Swoka Ikran
Standalone version

vtr. move


Maybe you should create debug version which prints what users entered during scramble game, it could help
Oe lu skxawng skxakep. Slä oe nerume mi.
"Oe tasyätxaw ulte koren za'u oehu" (Limonádový Joe)


Blue Elf

And one interesting output:
Word: game, uvan letokx sport

1 - swaw
2 - meyp
3 - uvan

vrrtep[1-5]:> 3

Srane! >:D score: 7

I looked into dictionary - it is written there in the same way. I think uvan letokx should be independent word (headword), on the different line (otherwise user has a hint)
Oe lu skxawng skxakep. Slä oe nerume mi.
"Oe tasyätxaw ulte koren za'u oehu" (Limonádový Joe)


Swoka Ikran

Quote from: Blue Elf on May 25, 2011, 04:16:02 PM
Great! But help doesn't say anything about -q switch. Readme is ok (unfortunately, it is not read earlier than everything goes wrong way :))
By help I'm assuming you mean the -h option? I'll add a note indicating that -l and other such can be used with -q...

Quote from: Blue Elf on May 25, 2011, 04:16:02 PM
Maybe you should create debug version which prints what users entered during scramble game, it could help
http://swokaikran.skxawng.lu/files/vcli_win_debug.zip - Standalone version only to keep size down.

When you enter an answer, you'll get "Response: <What you typed>" directly below it. The output should be EXACTLY what you enter. The output is not altered in any way.
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!


 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Tirea Aean

Quote from: Swoka Ikran on May 25, 2011, 05:10:38 PM
Quote from: Blue Elf on May 25, 2011, 04:16:02 PM
Great! But help doesn't say anything about -q switch. Readme is ok (unfortunately, it is not read earlier than everything goes wrong way :))
By help I'm assuming you mean the -h option? I'll add a note indicating that -l and other such can be used with -q...

Quote from: Blue Elf on May 25, 2011, 04:16:02 PM
Maybe you should create debug version which prints what users entered during scramble game, it could help
http://swokaikran.skxawng.lu/files/vcli_win_debug.zip - Standalone version only to keep size down.

When you enter an answer, you'll get "Response: <What you typed>" directly below it. The output should be EXACTLY what you enter. The output is not altered in any way.


way to beat me on that. ;D can you send me the files that you changed? I'm tryin my best to keep the linux/mac and windows versions parallel.

Swoka Ikran

#85
Quote from: Tirea Aean on May 25, 2011, 08:15:11 PM
way to beat me on that. ;D can you send me the files that you changed? I'm tryin my best to keep the linux/mac and windows versions parallel.
That debug version shouldn't be a public release...I hacked it together in ~2min for Blue Elf to test his unicode issue with. All the changes do is echo exactly what is typed in. If the program isn't receiving ä or ì properly, it'll echo garbage in place of them...

As for files changed, the only difference is in scramble.py. In the game() function, the bold line was added:
Quotea = raw_input("vrrtep:> ")
print "Response: "+a+"\n"
while a!= word and a!= "ans" and a!= "/quit" a

If you mean the help screen changes...that's not done yet.
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!


 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Tirea Aean

#86
Quote from: Swoka Ikran on May 25, 2011, 09:29:28 PM
Quote from: Tirea Aean on May 25, 2011, 08:15:11 PM
way to beat me on that. ;D can you send me the files that you changed? I'm tryin my best to keep the linux/mac and windows versions parallel.
That debug version shouldn't be a public release...I hacked it together in ~2min for Blue Elf to test his unicode issue with. All the changes do is echo exactly what is typed in. If the program isn't receiving ä or ì properly, it'll echo garbage in place of them...

As for files changed, the only difference is in scramble.py. In the game() function, the bold line was added:
Quotea = raw_input("vrrtep:> ")
print "Response: "+a+"\n"
while a!= word and a!= "ans" and a!= "/quit" a

If you mean the help screen changes...that's not done yet.

oh, okay.

I'll take care of the help screen for all versions

I also just took care of some things at request of a user:

clear the screen to make it look cleaner
use sleep to see program's response to your answer
record scores in both scramble and quiz in fraction and percents instead of integer accumulation

EDIT: also, I wanna actually get to antiprefix() and lenition before releasing again. this will be a major release.

Swoka Ikran

Quote from: Tirea Aean on May 25, 2011, 10:39:14 PM
I'll take care of the help screen for all versions
See end of this post.

Quote from: Tirea Aean on May 25, 2011, 10:39:14 PM
I also just took care of some things at request of a user:

clear the screen to make it look cleaner
I'm assuming this is only in the quiz/scramble?

Quote from: Tirea Aean on May 25, 2011, 10:39:14 PM
record scores in both scramble and quiz in fraction and percents instead of integer accumulation
Good idea :)

Quote from: Tirea Aean on May 25, 2011, 10:39:14 PM
EDIT: also, I wanna actually get to antiprefix() and lenition before releasing again. this will be a major release.
I just finished a bugfix release before I found your post. It eliminates the Python error that Blue Elf had about character mapping (the CMD now does a CHCP 437 when on non-English OSes to prevent a crash), and adds -q to the help screen. Do you want it or should I delete it and just wait?
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!


 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Tirea Aean

#88
yes, those changes are in the games.

uhm... sure, I'll take that and upload real quick.

Okay. seeing how things are going so far, is it even a good idea to have users download this? it gets updated extremely often.

EDIT: I will not be adding local translation to scramble. that makes it obvious what the answer is, defeating the purpose.

DOUBLE EDIT: How did you get the loop to work when using the -l param?

Swoka Ikran

Quote from: Tirea Aean on May 25, 2011, 11:12:07 PM
yes, those changes are in the games.

uhm... sure, I'll take that and upload real quick.
http://swokaikran.skxawng.lu/files/vcli_win.zip - That has the codepage and help screen fixes.

Quote from: Tirea Aean on May 25, 2011, 11:12:07 PM
Okay. seeing how things are going so far, is it even a good idea to have users download this? it gets updated extremely often.
Assuming there's no further issues, I don't see any reason why not. It works perfectly on English systems, and everything except scramble works on localized systems (when their locale is set to U.S. English.)

Quote from: Tirea Aean on May 25, 2011, 11:12:07 PM
EDIT: I will not be adding local translation to scramble. that makes it obvious what the answer is, defeating the purpose.
Agreed...I'd leave that out.
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!


 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Tirea Aean

does that contain both source and compiled? or is it just the compiled?

also, see my double edit.

Swoka Ikran

#91
Quote from: Tirea Aean on May 25, 2011, 11:24:35 PM
does that contain both source and compiled? or is it just the compiled?

also, see my double edit.
Both versions.

Quote from: Tirea Aean on May 25, 2011, 11:24:35 PM
DOUBLE EDIT: How did you get the loop to work when using the -l param?
The code looks to see if the first argument is a number. If so, I just call the program X number of times with whatever parameters the user set. Looping does not support putting the words on the command line right now. There's ways to support it, but the code is more complex and will come at a later date.

Off topic...Phillies game is in the 18th inning...last time a game went 17+ was in Baltimore in 2003.
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!


 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Blue Elf

Today's test with version from 12:10 am:
C:\WINDOWS>chcp 437
Active code page: 437

C:\WINDOWS>vrrtepcli -s

C:\WINDOWS>echo off
Vrrtep CLI v1.9 by Tirea Aean. run 'vrrtepcli -h' for usage.
Windows version by Swoka Ikran
Standalone version

*DEBUG VERSION*
word: zkeäw

vrrtep:> zekwä
Response: zekwä


Kehe. :\ score: -1

vrrtep:> ans
zekwä
score: -2
---trimmed-----
Srane! >:D score: 2

word: fro?txl -> ? not shown

vrrtep:> ans
Response: ans

ftx?lor -> ? not shown
score: 1

My thoughts:
1/ Windows$ MUST have set default nonUnicode locale to English, otherwise äì is not displayed correctly (on THIS computer i have set it to Czech, yesterday i tested on my home PC). Or there is some error in text output.....
2/ user input seems to be received correctly (according debug output), so problem seems to be in comparison. What about printing both entered and expected word as serie of hexa numbers?
Oe lu skxawng skxakep. Slä oe nerume mi.
"Oe tasyätxaw ulte koren za'u oehu" (Limonádový Joe)


Swoka Ikran

#93
Quote from: Blue Elf on May 26, 2011, 01:12:29 AM
My thoughts:
1/ Windows$ MUST have set default nonUnicode locale to English, otherwise äì is not displayed correctly (on THIS computer i have set it to Czech, yesterday i tested on my home PC). Or there is some error in text output.....
Yes it does...the East Europe code-pages (which are what is used by Czech) don't contain the characters you need, so Python mangles the output.

Quote from: Blue Elf on May 26, 2011, 01:12:29 AM
What about printing both entered and expected word as serie of hexa numbers?
Having just tried it for a few minutes, I just discovered that scramble is broken on English Windows as well...it marks right answers as wrong when they contain ä or ì. Unicode()'ing various things does not help and causes crashes. I need to look at it when I'm more alert (it's 3am here...)

Here's another debug version that gives the answer, as well as hex dumps of correct word and input: http://swokaikran.skxawng.lu/files/vcli_win_debug.zip

...using that version, the problem is VERY obvious on words with ì and ä...
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!


 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Blue Elf

Well, tried, here's result:
word: mphäeìt

debug: answer: tìpähem

debug: expected word as hex: 0000  74 c3 ac 70 c3 a4 68 65 6d
     t..p..hem

vrrtep:> tìpähem
debug: entered data: 0000  74 8d 70 84 68 65 6d                              t.p.hem

Kehe. :\ score: 1

vrrtep:> ans
tìpähem
score: 0

word: ìaxph

debug: answer: hapxì

debug: expected word as hex: 0000  68 61 70 78 c3 ac
     hapx..

vrrtep:> hapxì
debug: entered data: 0000  68 61 70 78 8d                                    hapx.

Kehe. :\ score: -1

Seems, that you get response like ANSI coded string, but compare it with UTF-8 coded string.
Oe lu skxawng skxakep. Slä oe nerume mi.
"Oe tasyätxaw ulte koren za'u oehu" (Limonádový Joe)


Blue Elf

and another improvement is needed for quiz game:
Word: group of people, party

1 - kaym
2 - pongu
3 - pongu

vrrtep[1-5]:>

two options are the same - occurred once during several hundreds of rounds, but is better to fix it.
Oe lu skxawng skxakep. Slä oe nerume mi.
"Oe tasyätxaw ulte koren za'u oehu" (Limonádový Joe)


Swoka Ikran

#96
Quote from: Blue Elf on May 26, 2011, 05:49:33 AM
Well, tried, here's result:
word: mphäeìt

debug: answer: tìpähem

debug: expected word as hex: 0000  74 c3 ac 70 c3 a4 68 65 6d
     t..p..hem

vrrtep:> tìpähem
debug: entered data: 0000  74 8d 70 84 68 65 6d                              t.p.hem

Kehe. :\ score: 1

vrrtep:> ans
tìpähem
score: 0

word: ìaxph

debug: answer: hapxì

debug: expected word as hex: 0000  68 61 70 78 c3 ac
     hapx..

vrrtep:> hapxì
debug: entered data: 0000  68 61 70 78 8d                                    hapx.

Kehe. :\ score: -1

Seems, that you get response like ANSI coded string, but compare it with UTF-8 coded string.
That appears to be it...looks like it's unicode() time...

Quote from: Blue Elf on May 26, 2011, 09:44:16 AM
and another improvement is needed for quiz game:
Word: group of people, party

1 - kaym
2 - pongu
3 - pongu

vrrtep[1-5]:>

two options are the same - occurred once during several hundreds of rounds, but is better to fix it.
I had that happen once...does need fixing because it gives away the answer :P
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!


 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Tirea Aean

Quote from: Blue Elf on May 26, 2011, 09:44:16 AM
and another improvement is needed for quiz game:
Word: group of people, party

1 - kaym
2 - pongu
3 - pongu

vrrtep[1-5]:>

two options are the same - occurred once during several hundreds of rounds, but is better to fix it.


they are both actually correct.

I could only find a way to heavily reduce the chances of this, not 100% get rid of all chance for it to happen. it probably happens now like 1 in a million or something. (linux version, not released yet)

Swoka Ikran

#98
Quote from: Tirea Aean on May 26, 2011, 11:58:53 AM
I could only find a way to heavily reduce the chances of this, not 100% get rid of all chance for it to happen. it probably happens now like 1 in a million or something. (linux version, not released yet)
Reducing odds is better than nothing :) but there may be a way to fully eliminate the issue. Not sure about Python, but in Autoit...(Comments added for clarity):


Can you send me your fix so I can put it in my version? As soon as I finish helping my friend with a crashed PC, I'm going to look into a fix for the unicode issue in scramble.
2010 was the year of the Na'vi.Vivar 'ivong Na'vi!


 
Avatray | NWOTD Sigbars | Sacred's Sigbar Tool | My collection of Avatar merchandise

Tirea Aean

Quote from: Swoka Ikran on May 26, 2011, 12:54:21 PM

Can you send me your fix so I can put it in my version? As soon as I finish helping my friend with a crashed PC, I'm going to look into a fix for the unicode issue in scramble.

I've ported your code and credited you in the comments and did some re-writing of the quiz module to make it fit. it currently works on the linux version.