Skip to content

Instantly share code, notes, and snippets.

@xquery
Created February 22, 2012 13:31
Show Gist options
  • Select an option

  • Save xquery/1885182 to your computer and use it in GitHub Desktop.

Select an option

Save xquery/1885182 to your computer and use it in GitHub Desktop.
xquery impl of fizzbuzz - can you do faster or more elegant ?
for $n in (1 to 100)
let $fizz := if ($n mod 3) then () else "fizz"
let $buzz := if ($n mod 5) then () else "buzz"
return
if ($fizz or $buzz) then concat($fizz,$buzz) else $n
@xquery

xquery commented Feb 27, 2012

Copy link
Copy Markdown
Author

Dimitre Novatchev 2 interesting solutions have been added to the wiki page

http://en.wikibooks.org/wiki/XQuery/Fizzbuzz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment