Skip to content

Instantly share code, notes, and snippets.

@caschwartz
Created May 28, 2014 14:46
Show Gist options
  • Select an option

  • Save caschwartz/b4063c6f68ce3eb7ed28 to your computer and use it in GitHub Desktop.

Select an option

Save caschwartz/b4063c6f68ce3eb7ed28 to your computer and use it in GitHub Desktop.
FizzBuzz in XQuery
xquery version "1.0-ml";
(: FizzBuzz puzzle :)
for $num in (1 to 100)
return
if ($num mod 3 = 0 and $num mod 5 = 0) then
"FizzBuzz"
else if ($num mod 3 = 0) then
"Fizz"
else if ($num mod 5 = 0) then
"Buzz"
else $num
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment