2011/3/28 jj mahoney <itshardtoget...@hotmail.com> > > Hi, How do I name this variable correctly, @{bet$random_bet_position); > With regards to the script below, @selected_bet is suppose to select either > @bet1, @bet2 or @bet3 depending on the chosen number held by > $random_bet_position, so how do I do this? Thanks > > @bet1 = (0,0,0,0); > @bet2 = (0,0,0,1); > @bet3 = (0,0,1,0); > > $random_bet_position = int(rand(3) + 1); > > @selected_bet = @{bet$random_bet_position); >
@bets = ( [0,0,0,0], [0,0,0,1], [0,0,1,0] ); @selected_bet = @{$bets[$random_bet_position]}; -- Robert Wohlfarth