nneonneo / 2048-ai

AI for the 2048 game
MIT License
1.09k stars 279 forks source link

2048.py reads initial block position but does not move in Windows #8

Closed karagand closed 10 years ago

karagand commented 10 years ago

When running 2048.py in Command Prompt in Windows 7 x64, I get this and then stops:

C:\Users\karagand>python 2048.py
       0        0        0        2
       0        0        0        0
       0        0        0        0
       0        0        2        0
Current approx. score: 0

I am using the most recent versions of Firefox (28.0) and RemoteControl (1.0). The numbers correspond with blocks displayed on the webpage, so it appears that the script is reading the initial position correctly but cannot effect change.

karagand commented 10 years ago

Could it be a plugin issue? Do I need any additional Firefox plugins/extensions for the script to work?

nneonneo commented 10 years ago

What does it do after showing the score? Does it just hang? Are there errors showing in the Web Inspector console?

On Sat, Mar 29, 2014 at 8:09 PM, karagand notifications@github.com wrote:

Could it be a plugin issue? Do I need any additional Firefox plugins/extensions for the script to work?

— Reply to this email directly or view it on GitHubhttps://github.com/nneonneo/2048-ai/issues/8#issuecomment-39013405 .

karagand commented 10 years ago

It ends after showing the score, like this:

C:\Users\karagand>python 2048.py
       0        0        0        2
       0        0        0        0
       0        0        0        0
       0        0        2        0
Current approx. score: 0

C:\Users\karagand>_ (flashing cursor)

No Error or Warning seen under Firefox Web Console.

nneonneo commented 10 years ago

Weird. What happens if you use "WinDLL" instead of "CDLL"?

On Sat, Mar 29, 2014 at 9:02 PM, karagand notifications@github.com wrote:

It ends after showing the score, like this:

C:\Users\karagand>python 2048.py 0 0 0 2 0 0 0 0 0 0 0 0 0 0 2 0 Current approx. score: 0

C:\Users\karagand>_ (flashing cursor)

No Error or Warning seen under Firefox Web Console.

— Reply to this email directly or view it on GitHubhttps://github.com/nneonneo/2048-ai/issues/8#issuecomment-39014365 .

karagand commented 10 years ago

Same result unfortunately. Replacing CDLL with WinDLL in 2048.py did not make a difference.

nneonneo commented 10 years ago

I'm currently installing Windows and Cygwin in a VM. Hopefully I can find out what the issue is.

nneonneo commented 10 years ago

The problem, as it turns out, is that loading Cygwin DLLs from non-Cygwin programs (like the python.org Python install) is fundamentally impossible because the C runtimes are different.

So, there are now two options: compile a non-Cygwin DLL using MinGW (or the MinGW compiler available as an optional package in Cygwin), or use the Cygwin Python (preinstalled) to run the app. The latter is probably easier, but I'll add instructions for all of these choices.

nneonneo commented 10 years ago

I believe commit aa4e79e9f4 fixes this issue, by offering a few ways to compile this program on Windows.

matukaa commented 10 years ago

working like a charm :) thank you, and i appreciate your work

matukaa commented 10 years ago

by the way, I didn't change anything with my files, I just installed python into cygwin, runned, and it worked. the changes were not needed, only to run python within cygwin