Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. :- %say
  2. |= [[* eny=@uvJ *] [x=@ud y=@ud ~] ~]
  3. :- %noun
  4. =< (deal x y)
  5. |%
  6. ++ deck
  7. |.
  8. ^- (list [@t @t])
  9. =/ r=(list @t) ~['2' '3' '4' '5' '6' '7' '8' '9' '10' 'J' 'Q' 'K' 'A']
  10. =/ s=(list @t) ~['♥' '♣' '♦' '♠']
  11. =| acc=(list [@t @t])
  12. |- ^- (list [@t @t])
  13. ?~ s acc
  14. %= $
  15. s t.s
  16. acc |- ?~ r acc
  17. $(r t.r, acc [[i.r i.s] acc])
  18. ==
  19. ++ shuffle
  20. |= x=(list [@t @t])
  21. ^- (list [@t @t])
  22. =| acc=(list [@t @t])
  23. =+ rng=~(. og eny)
  24. |- ^- (list [@t @t])
  25. ?~ x acc
  26. =/ r (rads:rng (lent x))
  27. =/ v=[@t @t] (snag -:r `(list [@t @t])`x)
  28. =/ t=(list [@t @t]) (oust [-:r 1] `(list [@t @t])`x)
  29. $(acc [v acc], x t, rng +:r)
  30. ++ deal
  31. |= [x=@ud y=@ud]
  32. ^- (list (list [@t @t]))
  33. =/ r=(list [@t @t]) (shuffle (deck))
  34. =| acc=(list (list [@t @t]))
  35. |- ^- (list (list [@t @t]))
  36. ?: =(x 0) acc $(x (dec x), r (slag y r), acc [(scag y r) acc])
  37. --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement