Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

MyCoolStory.cpp

Name: Anonymous 2011-04-06 9:56

>write awesome but buggy as hell C program to kick ass at minesweeper
>1 second top score on expert mode.  .47 seconds if I use a clone that keeps track of decimals.
>nagging feeling that I'm being a noob by writing in C and not C++
>learn C++ and rewrite program using classes and maps and vectors and lists and that kind of shit instead of just arrays.
>program works perfectly now, code is much cleaner, but it can't solve an expert board in under 10 seconds
>switch on every speed optimization I can find in Visual Studio
>times down to 6-7 seconds
>decide to rewrite the whole thing in C again from scratch so maybe it can be fast AND reliable at the same time
>change mind and decide to bitch to /prog/ instead and then take a nap

Name: Anonymous 2011-04-12 1:20

>>48
When the program calculates that a square is safe to click, it sends the click and immediately starts trying to read its new state from the screen.  Sometimes the game doesn't update fast enough, and the program will loop until it gets a valid read,  but sometimes it'd get a mix of the old state (an unclicked square) and the new state (a "3", for instance), and the program would get confused since the mix of data actually corresponded to a completely different state.

I fixed it by just choosing a different (and actually smaller) set of pixels to poll, where that kind of thing won't happen.

Record's down to .23 seconds already thanks to the speed improvement from not needing to poll as many pixels.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List