All pastes #370500 Raw Edit

Untitled

public text v1 · immutable
#370500 ·published 2007-02-24 16:59 UTC
rendered paste body
alias uno_setup {
 ...

 ; Just some cards (You probably don't want to change this)
  set %uno_opt_regcards 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 S S S D2 D2 D2 R R R
  set %uno_opt_speccards W W W W WD4 WD4 WD4 WD4
}

alias uno_makedeck {
  var %t = 1, %d = 1, %i
  hfree -w uno.cards
  hmake uno.cards

  while (%d <= 4) {
    %i = 1
    while (%i <= 28) {
      hadd uno.cards %t $iif(%d == 1, R_, $iif(%d == 2, G_, $iif(%d == 3, B_, $iif(%d == 4, Y_, 0_)))) $+ $gettok(%uno_opt_regcards,%i,32)
      inc %i
      inc %t
    }
    inc %d
  }

  %i = 1
  while (%i <= 8) {
    hadd uno.cards %t $+(X_,$gettok(%uno_opt_speccards,%i,32))
    inc %i
    inc %t
  }
}