That's what it's all about

Aug 14, 2008 15:04


Warning - today's post is waaay more geeky than usual.
If you're not comfortable with fundamental-level programming concepts, best skip this one..

OK, I've rabbited on loads about Graphjam of late, but one more time.. Found a charming flow chart diagram for the Hokey Cokey, and it struck me the dance is essentially a series of FOR (or DO or WHILE ( Read more... )

Leave a comment

ext_96109 August 20 2008, 12:44:14 UTC
Like what you did there ;-)
And since you've caught me on a dull day in the office, here's how I would have structured it:

Dim body_part

Dim body(4)
body(0)="left arm"
body(1)="right arm"
body(2)="left leg"
body(3)="right leg"
body(4)="whole self"

function header()

response.write("The Hokey Cokey!")
response.write("The Hokey Cokey
")

end function

function verse(item)

response.write("
")
response.write("You put your " & item & " in,
")
response.write("You put your " & item & " out,
")
response.write("In, out, in, out
")
response.write("Shake it all about.
")
response.write("You do the hokey cokey and you turn around,
")
response.write("That's what it's all about.")
response.write("
")

end function

function chorus()

Dim woah

response.write("
")

for woah = 0 to 2
response.write("Woah, hokey cokey cokey,
")
next

response.write("Knees bent, arms stretched, ra ra ra!")
response.write("
")

end function

function footer()

response.write("")

end function

header()
for body_part=0 to UBound(body) step 1
verse(body(body_part))
chorus()
next
footer()

Disclaimer: I know only as much VBScript as I managed to glean from your post ;-)

Reply


Leave a comment

Up