• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Scrabble anyone? [it's Friday]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scrabble anyone? [it's Friday]


  • Subject: Scrabble anyone? [it's Friday]
  • From: Martin Orpen <email@hidden>
  • Date: Fri, 05 Nov 2004 11:41:11 +0000

Title: Scrabble anyone? [it's Friday]
My scramble handler for shuffling cards got me to thinking about another application:

--
Scrabble practice...
set
myList to do shell script "awk 'length == 7' /usr/share/dict/words | tr \"A-Z\" \"a-z\""
set
myWord to some paragraph of myList

set theTest to scramble(myWord)
repeat 3 times
   set
theTest to scramble(theTest)
end repeat

set
myGuess to (text returned of (display dialog "What word is this:  " & theTest & return default answer ""))

if
myGuess is equal to myWord then
   display dialog "Congratulations!" & return &
myWord & " was the correct answer"
else
   display dialog "Sorry, the correct answer was: " &
myWord
end if

on
scramble(x)
    
set newWord to {}
    
repeat with
i in text items of x as string
       if some item of {true, false} then
           set end of
newWord to contents of i
       else
           set beginning of
newWord to contents of i
       end if
   end repeat
   return
newWord as string
end
scramble



Damn there are some difficult words in that list :-(

--
Martin Orpen
Idea Digital Imaging Ltd -- The Image Specialists
http://www.idea-digital.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Scrabble anyone? [it's Friday]
      • From: Graff <email@hidden>
  • Prev by Date: Re: [~ot] those pesky invisible folders ...
  • Next by Date: Re: Bridge anyone? [not off topic]
  • Previous by thread: Re: Is there a bug in iCal's reschedule event?
  • Next by thread: Re: Scrabble anyone? [it's Friday]
  • Index(es):
    • Date
    • Thread