This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare variable $deck-counter := map:map(); | |
declare variable $deck := map:map(); | |
declare function local:get-card($num) { | |
let $card := map:get($deck-counter, xs:string($num)) | |
let $_ := xdmp:log(fn:concat("card: ", $card, " $num: ", $num), "debug") | |
return | |
(: call recursively with another rand number, if the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare variable $deck-counter := map:map(); | |
declare variable $deck := map:map(); | |
declare function local:get-card($num) { | |
let $card := map:get($deck-counter, xs:string($num)) | |
return | |
if (fn:empty($card)) then | |
local:get-card(xdmp:random(52)) |