- Posted by Grape_ Vine_ <g__vine at HOTMAIL.COM> Dec 09, 2000
- 1950 views
Well i found the problem, But i have no clue what the problem is I swiched the order to sequence Shuffling_Deck atom temp, temp_1, card_2 Shuffling_Deck() = New_Deck() And it works just fine, Again, Anyone have any idea what is going on here?????? >From: Grape_ Vine_ <g__vine at HOTMAIL.COM> >Reply-To: Euphoria Programming for MS-DOS <EUPHORIA at LISTSERV.MUOHIO.EDU> >To: EUPHORIA at LISTSERV.MUOHIO.EDU >Date: Sat, 9 Dec 2000 15:30:58 -0800 > >First, This function is broken, Any ideas why? I get the error > >Syntax error - expected to see =, +=, -=, *=, /= or &= > Shuffling_Deck() = New_Deck() > ^ >Wich if i remove the () changes to > >Syntax error - expected to see possibly 'end', not a type > atom temp, temp_1, card_2 > ^ >The only way to stop the errors is to rem out > Shuffling_Deck() = New_Deck() > >Any ides??? > >Also, Is this the best way to swap two elements of an sequence? > > >function shuffle() > sequence Shuffling_Deck > Shuffling_Deck() = New_Deck() > atom temp, temp_1, card_2 > for card = 1 to 52 do > temp = Shuffling_Deck[card] > card_2 = rand(52) > temp_1 = Shuffling_Deck[card_2] > Shuffling_Deck[1] = temp_1 > Shuffling_Deck[card_2] = temp > end for >return Shuffling_Deck > > > >J Reeves >Grape Vine >ICQ# 13728824 > >>_____________________________________________________________________________________ >Get more from the Web. FREE MSN Explorer download : >http://explorer.msn.com _____________________________________________________________________________________ Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com