Jump to content

Recommended Posts

Posted (edited)

I've made a hangman program and i have a set number of answers (it runs via a php script) I want to make an auto solver for it that can select the play field which looks similar to

_ _ _ _ _ _ _ _ _ _ _ _ &_ _ _ _ _ _ _ _ &_ _ _ & _ _ _

_ _& _ _ _ _ _ _ _ & _ _ _ _ _ _ _

It post really bad so i'm gonna replace the double sapces with a & but in real life they are double spaces.

The words are seperated bye double spaces and the individual letters are by single splits.

To solve the puzzles i have all the known solutions in arrays that are based on the nubmer of words in the puzzle. So it begins by highlighting the field sending that to the clipboard putting it in a variable and then i attempt to split it by every " " (double space) but for some reason its returning a $spacesplit[0] is equal to 58 which is not right. Is there a way i can use a double space as a delimiter for stringsplit without having it split at single spaces, or does someone have a better idea to solving this?

This is the script i'm using to see what it spltis like:

mousemove(145,742)

Mousedown("Left")

MouseMove(692,801)

MouseUP("Left")

sleep(250)

send("{CTRLDOWN}c{CTRLUP}")

$blank_puzzle = clipGet()

$2space = " "

$word_count = StringSplit($blank_puzzle, $2space)

msgbox(0, "", $word_count[0])

The message box returns something in the 50s

Edited by cooldude832
Posted

You got a link to the hangman?

Posted

I guess my real question is can i use a double space as a delimiter without it picking up single spaces? Cause autoit seems to ignore whitespace in excess of 1

Posted

I did something like this:

Global $sAnswer[3]
$sAnswer[0] = StringSplit("BRONTO BITES ARE ALL THE RAGE AND THEY ARE MEATY AND VERY EASY TO CARRY", " ")
$sAnswer[1] = StringSplit("WITH THE RIGHT TRAINING TUSKANINNIES CAN BECOME QUITE FEARSOME FIGHTERS", " ")
$sAnswer[2] = StringSplit("YOU SHOULD NOT THROW BASEBALLS UP WHEN THE CEILING FAN IS ON", " ")
Posted

I did something like this:

Global $sAnswer[3]
$sAnswer[0] = StringSplit("BRONTO BITES ARE ALL THE RAGE AND THEY ARE MEATY AND VERY EASY TO CARRY", " ")
$sAnswer[1] = StringSplit("WITH THE RIGHT TRAINING TUSKANINNIES CAN BECOME QUITE FEARSOME FIGHTERS", " ")
$sAnswer[2] = StringSplit("YOU SHOULD NOT THROW BASEBALLS UP WHEN THE CEILING FAN IS ON", " ")

I've got the rest of the script my issue is in looking at the original puzzle and gathering information off it like # of words in it etc etc.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...