Friday, October 23, 2009

Little reversing algorithm (non-recursive)

I will make a recursive algorithm for reversing later. I wrote this in applescript because it will be easier to follow since it is highly English-based.

tell application "Finder"

set answer to ""

display dialog "Input:" default answer ""

set userInput to text returned of result

set counter to count of userInput

repeat while counter is not equal to 0

set answer to answer & item counter of userInput

set counter to counter - 1

end repeat

display dialog answer

end tell

No comments:

Post a Comment

Search This Blog