Coding Lecture 3 - 13/10/95 =========================== Carlin Auditorium You are catapulted back into the late 20th century as you step through the double doors and into the dimness of the back of the Auditorium. As your eyes become accustomed to the lacklight, you begin to appreciate the beauty of this unique Terran decor. More than 200 seats, divided by two wide aisles spread over the main floor. An overhanging balcony provides additional seating. Three luxurious private boxes, obviously for visiting dignitaries, are visible on either side of the expansive walls. Thick red and gold carpeting covers the floor. All seating is upholstered in plush red velvet, a common covering for the era that is being depicted here. Two large gold pillars stand like silent sentinels on either side of a stage that spans the full width of the room. The only hint that you are still in your own time are the three familiar flags; Starfleet, Federation, and that of Starfleet Academy that stand proudly on the left side of the stage. Contents: WiP(#126vI) Ulysses_Omega Kramton Final Test Section Obvious exits: Out *Mark_Farrell* Ensign Kramton is looking at you. You say "Okay, have you done any coding before, Kramton?" Kramton says "Very little...only on the Holodecj" Mark_Farrell nods. 011 has arrived. 011 enters from the Quad. Kramton says "Hello, how's the baby?" You say "Okay, have you seen the copies of the previous two lectures?" 011 smiles Mark_Farrell smiles as 011 comes in. 011 snaps to attention Kramton says "I was unaware of them." You say "At ease, 011. No need for that." 011 says "The baby is comming along fine(He is in the Hospital" 011 relaxes Mark_Farrell nods. "Okay, no matter. Just break in and ask if you have a question." Kramton nods Riverful has arrived. Riverful enters from the Quad. 011 sits in the back Jacqueline has arrived. Jacqueline enters from the Quad. Mark_Farrell smiles. "Okay, I propose to continue with the example project from last lecture, and to move it forwards." Jacqueline sits down quietly Riverful sits down. You say "In summary of progress so far, the example project is a Poker Table." You say "Feel free to 'examine wip' to look at the code so far." Kramton whoas 011 nods Archangel has arrived. Archangel enters from the Quad. WiP(#126vI) Owner: Mark_Farrell Credits: 1 Status: Thing Org: None(#-1) Type: Thing Flags: visible inherit Race:Mechanoid Vc:Ace Two Three Four Five Six Seven Eight Nine Ten Jack Queen King Joker Va:$test *:@emit > %N types %0. The value returned is 'The [extract(v(vc),band(v(0),15),1)] of [lookin(v(vb),band(v(0),240),1)]'. Vb:16 Clubs 32 Diamonds 64 Hearts 128 Spades Lock:Mark_Farrell(#16055PDeoqFc) Home: Ready Room Location: Carlin Auditorium Kramton nods Archangel nods Mark_Farrell smiles. "Last week we decided on the basic strategy of storing the cards. You say "Basically, a single number will represent the face value and suit." *WiP(Mark_Farrell)* > Mark_Farrell types 65. The value returned is 'The Ace of Hearts'. *WiP(Mark_Farrell)* > Mark_Farrell types 66. The value returned is 'The Two of Hearts'. *WiP(Mark_Farrell)* > 011 types 32. The value returned is 'The of Diamonds'. 011 smiles You say "WIP/va recognizes the command 'test ' and returns the string you typed." *WiP(Mark_Farrell)* > Kramton types 38. The value returned is 'The Six of Diamonds'. You say "Is everyone familiar with binary number, and binary maths?" *WiP(Mark_Farrell)* > Riverful types 1. The value returned is 'The Ace of '. Riverful nods. 011 smiles 011 's whole family are Binary numbers You say "Okay, the face value is stored in bits 0-3, and bits 4 through 7 represent the suit." You say "b4 is 1 for clubs, b5 diamonds, b6 hearts, b7 spades." You say "This gives us a valid range for cards of 16+(1 to 13), 32+(1 to 13), 64+(1 to 13) and 128+(1 to 13)" *WiP(Mark_Farrell)* > Riverful types 141. The value returned is 'The King of Spades'. You say "So, from the list of things we had to do from last week:" You say "1. Store a deck of cards." You say "We have decided _how_ to store them, next we need to put this into practice." You say "The test command has shown that we can turn the numbers onto a 'user-friendly' form easily." You say "Okay. I'm going to put a list of cards into one of the registers..." Xa:[iter2(lnum(13),{[add(##,16)]})] Xa:17 18 19 20 21 22 23 24 25 26 27 28 29 *WiP(Mark_Farrell)* > Mark_Farrell types 29. The value returned is 'The King of Clubs'. Kramton says "To see the program, type say Computer, run program from holochip." WiP(#126vI) Owner: Mark_Farrell Credits: 1 Status: Thing Org: None(#-1) Type: Thing Flags: visible inherit Race:Mechanoid Vc:Ace Two Three Four Five Six Seven Eight Nine Ten Jack Queen King Joker Va:$test *:@emit > %N types %0. The value returned is 'The [extract(v(vc),band(v(0),15),1)] of [lookin(v(vb),band(v(0),240),1)]'. Vb:16 Clubs 32 Diamonds 64 Hearts 128 Spades Lock:Mark_Farrell(#16055PDeoqFc) Xa:17 18 19 20 21 22 23 24 25 26 27 28 29 33 34 35 36 37 38 39 40 41 42 43 44 45 65 66 67 68 69 70 71 72 73 74 75 76 77 129 130 131 132 133 134 135 136 137 138 139 140 141 Home: Ready Room Location: Carlin Auditorium Mark_Farrell finishes. New registers are vd and xa You say "VD contains a command to produce a 'clean' deck in xa. XA holds the current cards." You say "VD: $new deck:@xa me=[iter2(lnum(13),{[add(##,16)]})] [iter2(lnum(13),{[add(##,32)]})] [iter2(lnum(13),{[add(##,64)]})] [iter2(lnum(13),{[add(##,128)]})]" You say "So, when you type 'new deck' the @xa me=.... code is run." 011 nods Kramton says "Im lost with all this iter2 stuff.." You say "Using lnum(13) gives me a list of numbers: 1 2 3 4 5 6 7 8 9 10 11 12 13" You say "So, breaking the set command down, we have : iter2(1 2 3 4 5 6 7 8 9 10 11 12 13,{stuff})" Kramton says "Ok." You say "Iter operates in a similar manner to an @dolist." You say "However, it is _much_ easier for the game to understand." 011 notes that there is no help iter2 Mark_Farrell nods. "It is undocumented and will change in operation when it is hardcoded. You say "I'm only using it to avoid using an @dolist" No help for 'iter'. Mark_Farrell looks at {stuff} in more detail. You say "Now, the {} group the commands that we want iter to operate on together. Without them, the iteration function does not work." You say "Stuff is simple in this case (and should be fairly simple for all iter() loops!). Just an 'add(##,16)'" You say "## works the same was as for an @dolist, and is replaced with 1, 2, 3....13" You say "So, iter(lnum(13),{16}) is a simple way to give us a list of numbers 17 to 29. (Or 16+<1 to 13> as I said the valid range was earlier)." Archangel has disconnected. You say "Repeated 4 times, once for each suit, we can produce a representation of the complete deck." 011 is amazed that he actually understands Mark_Farrell must be getting better at explaining. Mark_Farrell smiles. You say "Any questions - anything not clear." Kramton never knew anything to start.... Mark_Farrell is here to answer questions as well as demonstrate. He sips a glass of water. Kramton says "I think I missed too much in the first two..." Mark_Farrell nods at Kramton. "+mail me you email address, and I'll mail you the two previous lectures." Archangel has connected. Carlin Auditorium You are catapulted back into the late 20th century as you step through the double doors and into the dimness of the back of the Auditorium. As your eyes become accustomed to the lacklight, you begin to appreciate the beauty of this unique Terran decor. More than 200 seats, divided by two wide aisles spread over the main floor. An overhanging balcony provides additional seating. Three luxurious private boxes, obviously for visiting dignitaries, are visible on either side of the expansive walls. Thick red and gold carpeting covers the floor. All seating is upholstered in plush red velvet, a common covering for the era that is being depicted here. Two large gold pillars stand like silent sentinels on either side of a stage that spans the full width of the room. The only hint that you are still in your own time are the three familiar flags; Starfleet, Federation, and that of Starfleet Academy that stand proudly on the left side of the stage. Contents: Archangel Jacqueline Riverful 011 WiP(#126vI) Ulysses_Omega Kramton Final Test Section Obvious exits: Out Kramton nods [FrlYng] Mark_Farrell has joined this channel. FrlYng added to your channel list. Kramton says "Carry on." Archangel has disconnected. *Mark_Farrell* Mark_Farrell lags. Kramton is lagging too You say "Riverful, Jacueline, any questions?" Riverful whispers "Would you please mail me also those previous lectures?" Mark_Farrell put the q in. Jacqueline shakes her head no You whisper-posed Riverful with "Mark_Farrell nods. Sure.". You say "Alright. What do we need to do now?" Kramton says "Make it hand out cards to players?" 011 raises a hand Description set. 011 says "And remember what's been dealt" *Mark_Farrell* Time : Fri Oct 13 18:33:52 1995, Stardate : 95781.8 18:33:52 Mark_Farrell nods. You say "Okay. Lets examine handing out cards." You say "Ideas on _how_ to do it." You say "Noone?" Kramton shakes his head 011 raises a hand You say "Shoot 011." 011 says "Use the rnd command to put cards in two registers(one for reference of whats been dealt)." 011 says "Different registers for different players, etc" Mark_Farrell nods. 011 isn't sure how to communicate them to the one player only though You say "Okay. So, we need to be able to :" You say "1. Deal a random card." You say "2. Remember that card." You say "3. Give it to a specific player." 011 nods You say "4. Tell that player their card." You say "Whenever you tackle a problem you should try to identify all the parts that make it up." You say "Now, if we are going to eventually get around to coding a poker game, we also need to deal with 'hole' cards, face up, different numbers of cards, and so forth." You say "I don't propose to deal with that now." Kramton understands You say "So, if we consider the first point, we have a couple of choices:" You say "A. Shuffle the entire list once at the start, and just take the first card." You say "B. Take a random card from the list." Mark_Farrell looks around. "Yes?" Mark_Farrell wants some feedback... Kramton is clueless 011 would guess random... wouldn't know how to shuffle You say "Okay, I was fishing for any other methods/ideas for doing this. Independantly of thinking of the musecode for it." *Mark_Farrell* Cadet Riverful is looking at you. Mark_Farrell returns the the importance of making informed choices for the way you do something. Thinking of an efficient way to do something in real life can often lead to an economic solution in musecode too. 011 nods 011 says "Shuffle then" Mark_Farrell smiles. "Anyway, lets plough on with those two. Lets take A first." You say "Shuffling. There is a muse shuffle function." No help for 'shuffle'. 011 smiles Mark_Farrell sighs. "Again it is undocumented. Kramton is taking notes Mark_Farrell asked Yngwie to add it last time he coded a poker table :-) Kramton snickers You say "However, it is limited in what it can do. It will take upto 17 random items from a list, and returns them in the following form." You whisper "2_4_5_7: 1 3 6" to Mark_Farrell. Mark_Farrell whispers "2_4_5_7: 1 3 6" Jacqueline goes home. Jacqueline has left. You say "1_4_5_6: 3 2 7 is the result of shuffle(1 2 3 4 5 6 7, 3)" Kramton huhs You say "The first group of numbers is the remaining items in the list that were not picked, and the numbers after the : are the random 3 that were chosen." Kramton says "oh." 011 ahhs You say "Ie, the syntax for shuffle is:" You say "shuffle(list of items,number you want)" Kramton says "got it." Kermaani has arrived. Kermaani enters from the Quad. Kermaani takes a seat. You say "Okay, this should ring some useful bells about how we can easily take a number of cards from the deck." Kramton smiles Mark_Farrell introduces the 'rest()' function. Read 'help rest function' 011 nods Kermaani notices he has to go, and head out the door. Kermaani leaves the Auditorium. Kermaani has left. You say "So, using rest(shuffle(list,number)) will give us a random list of cards." You say "Do you follow that, Kramton, Riverful?" Kramton says "I got it." Saving TrekMUSE DataBase. Response will be slow for a few minutes. Riverful says "Sure." Mark_Farrell smiles at 011. "There is a problem with this though. Can anyone see what it is." 011 raises his hand You say "011." 011 says "They may be taken already?" Mark_Farrell nods. Kramton raises his hand You say "That's right. How do we remember which cards have been taken already?" You say "Kramton." 011 wonders if the match command is next Kramton says "DOes rest work with only coding commands?" You say "Well, rest is a function, and it will return the 'rest' of anything you give it. As a function it has to (mostly) follow a command. Commands start with an '@'. Eg, @xa me=2 3 4 5 would execute command @xa me, to set my xa register, and then the 'rest' function would return 2 3 4 5. So, in effect, my xa register would become 2 3 4 5" You say "Is that what you meant? If not can you give an example of what you mean." Kramton says "Yeah." Mark_Farrell goes back to 011's suggestion about match. 011 says "Match with the 'whats been taken' register" You say "We could try to use match to see if any of the cards have been used before." 011 nod You say "It begs the question - what to we do if they have been?" 011 says "Take more cards..." You say "A 'do-until' type construction is not easy to code in muse, and is certainly not particularly efficient." 011 nods You say "However, it's a solution." 011 raises his hand. You say "DO , UNTIL " Mark_Farrell will come to you soon 011. "Does everone follow that idea?" Kramton says "um, I think so." 011 says "Would it then be better to shuffle?(no chance of pre-taken cards)" Riverful says "Yes." 011 ohs You say "Okay, so 011, you're suggesting that we shuffle the entire deck to start with?" 011 nods Mark_Farrell nods. "Then we could just use 'first()' to get a card." 011 says "shuffle xa and then take from it one by one(using the rest command to chop it off the list)" 011 nods Kramton actually understood that You say "Okay, so that seems to be nice and easy. We only have to bother to shuffle once, and then we can use _simple_ functions to deal." Mark_Farrell is going to repeat again "The object of coding the game is two fold. You say "1. Produce a 'useful' object/device" You say "2. Do it as efficiently as you possibly can." Mark_Farrell defines 'useful' in its broadest sense - improving Roleplay, making something easier, etc. You say "The once snag with shuffle I mentioned earlier is that the maximum number we can take from the list it 17." Mark_Farrell demonstrates using 'say [shuffle(get(wip/xa),17)]' You say "17_19_21_22_24_25_26_28_29_33_34_35_36_37_38_40_42_43_44_66_70_72_74_75_76_129_130_131_134_135_136_137_138_139_140_141: 39 69 133 132 67 41 18 20 23 73 45 65 77 27 68 71" Mark_Farrell tries again with 52 instead of 17. You say "17_19_20_21_22_23_24_27_28_33_34_35_36_37_38_39_40_41_42_43_44_65_68_70_73_74_76_129_131_134_135_137_138_139_140_141: 45 132 133 130 69 26 72 66 71 29 75 18 77 136 67 25" 011 notes that you could then break it down and shuffle to components (of registers)?? 011 neverminds Mark_Farrell nods at 011. So, you should notice we are going to have to do at least 4 shuffles to do all 52 cards. 011 nods Riverful says "One for each suit?" *Mark_Farrell* Time : Fri Oct 13 19:10:45 1995, Stardate : 95781.8 19:10:45 You say "Did you all follow the point I'm trying to make here that the shuffle isn't going to be as easy as it could be." Kramton says "So I see." Mark_Farrell looks at Arnie. "Now, if we did one for each suit we would have 4 separete lists of 13 shuffled cards." You say "We still need to mix the suits afterwards." 011 says "By shuffling 4 registers?" 011 shrugs Riverful says "Right. Thats what I thought." You say "However, if we mix 4 separate lists, the total becomes more that 17 again. Read 'help edit function'." Kramton says "If you'll excuse me...I gotta go." Mark_Farrell nods. Kramton says "gotta go." Kramton leaves the Auditorium. Kramton has left. 011 raises his hand You say "Take care - mail me your email address, and I'll post you the logs." You say "011." 011 says "Do a shuffle, and then delete the result from XA and then do another and so on?" Mark_Farrell nods. "Very close. What I'm going to do is to shuffle xa, and store the result, then shuffle the first() of the result, and do that another 3 times. 011 nods You say "The first time will give us 13 (N=13) random cards from 52, the second 13 from 39, the 3rd 13 from 26, and finally, 13 from 13." You say "All we need to do then is glue them all back together." You say "Everyone follow?" 011 nods (close to my idea) You say "Riverful?" Carlin Auditorium You are catapulted back into the late 20th century as you step through the double doors and into the dimness of the back of the Auditorium. As your eyes become accustomed to the lacklight, you begin to appreciate the beauty of this unique Terran decor. More than 200 seats, divided by two wide aisles spread over the main floor. An overhanging balcony provides additional seating. Three luxurious private boxes, obviously for visiting dignitaries, are visible on either side of the expansive walls. Thick red and gold carpeting covers the floor. All seating is upholstered in plush red velvet, a common covering for the era that is being depicted here. Two large gold pillars stand like silent sentinels on either side of a stage that spans the full width of the room. The only hint that you are still in your own time are the three familiar flags; Starfleet, Federation, and that of Starfleet Academy that stand proudly on the left side of the stage. Contents: Riverful 011 WiP(#126vI) Ulysses_Omega Final Test Section Obvious exits: Out Riverful says "I guess so." Riverful smiles. You say "Okay, let me code that onto the WiP...." Ve: Ulysses_Omega must leave, bye Ulysses_Omega leaves the Auditorium. Ulysses_Omega has left. You say "Okay, 'examine wip/ve' and them I'll go through what it does." You say "VE: $shuffle:new deck;@xb me=[shuffle(get(me/xa),13)];@xc me=[shuffle(de_(first(get(me/xb))),13)];@xd me=[shuffle(de_(first(get(me/xc))),13)];@xe me=[shuffle(de_(first(get(me/xd))),13)]" You say "First, functions we've not seen before: de_()" You say "The removes underscores from the parameter sent to it." You say "So, de_(1_2_3_4) is 1 2 3 4." 011 ahh 011 says "VERY usefull" You say "It is functionally equivalent to edit(1_2_3_4,_,spc(1)), but much shorter to type." 011 nods You say "So, if you remember the output from shuffle() gave us a list list 1_2_3_4:, you can see that it'd be useful for turning that into a list we can shuffle next time." You say "...a list like..." Mark_Farrell breaks down the shuffle command step by step now: You say "'new deck' causes a 'clean' pack to be put into xa. (It triggers the command we defined earlier)." You say "Then we have: @xb me=[shuffle(get(me/xa),13)]" 011 understands You say "Now, this sets the xb register on 'me' (the WIP) to be thre result of the shuffle." You say "get(me/xa) returns the contents of 'my' (the WIP's) xa register." Locked. Mark_Farrell does that manually. Xb:[shuffle(get(wip/xa),13)] Xb:[shuffle(get(wip/xa),13)] Xb:20_22_23_25_26_27_28_29_33_34_35_36_37_38_40_41_42_44_45_65_66_67_68_69_70_71_73_75_76_77_129_131_134_135_136_138_139_140_141: 21 19 72 18 39 130 74 133 24 132 43 137 17 You say "Okay, if you examine wip/xb you will see: 20_22_23_25_26_27_28_29_33_34_35_36_37_38_40_41_42_44_45_65_66_67_68_69_70_71_73_75_76_77_129_131_134_135_136_138_139_140_141: 21 19 72 18 39 130 74 133 24 132 43 137 17" You say "Going back to the shuffle command, the next thing in the list was: @xc me=[shuffle(de_(first(get(me/xb))),13)]" You say "Consider just the de_(first(get(me/xb)))." You say "When looking at how code works, remember to work from the inside out." You say "So, it gets the contents of me/xb, then takes the first() of that, and then removes the underscores from the first()." Mark_Farrell pauses and looks around. "Any questions." Riverful says "Hmm. What is me/xb?" You say "Okay, 'me' is a term for the thing that is going the code. In the case of the shuffle command it is the contents of the xb register on 'me' - ie, the xb register of the WiP." 011 nods You say "going=doing. It is used to specify the object/register combination." Riverful nonds. You say "Anything else?" Mark_Farrell smiles. You say "Okay then. The result of de_(first(get(me/xb))) is: 20 22 23 25 26 27 28 29 33 34 35 36 37 38 40 41 42 44 45 65 66 67 68 69 70 71 73 75 76 77 129 131 134 135 136 138 139 140 141:" You say "Going back to the function we are looking at, shuffle(de_(first(get(me/xb))),13), this gives us shuffle(20 22 23....139 140 141:,13)" You say "Okay so far?" Riverful says "Okay." 011 nods You say "Please stop me as soon as I say something you don't follow." You say "Okay, so, the complete command @xc me=[shuffle(de_(first(get(me/xb))),13)] will do what we want - ie take another 13 random items." You say "...from the leftovers of the first shuffle, and store them in the xc register." Mark_Farrell does the command manually.... Xc:22_23_25_26_28_29_33_34_35_36_40_44_65_68_69_70_71_75_76_77_129_131_138_139_140_141:: 66 134 38 41 67 73 20 45 136 27 42 37 135 Riverful peers at the Binars. You say "Okay, so XC: 22_23_25_26_28_29_33_34_35_36_40_44_65_68_69_70_71_75_76_77_129_131_138_139_140_141:: 66 134 38 41 67 73 20 45 136 27 42 37 135" You say "We've got two ::'s now, but I'll cover that shortly." You say "The next thing we did was identical to what I just went through, excpt that is takes the leftovers in xc, and stores them in xd. @xd me=[shuffle(de_(first(get(me/xc))),13)]" You say "Okay?" Riverful says "What do you mean 'leftovers'?" 011 understands You say "Well, the 'first()' of xc - the list of cards that are still available to be chosen." Riverful says "Ok." Mark_Farrell does that manually. You say "Okay, so XD is 25_26_33_36_40_44_65_68_69_70_131_138_139: 141:: 129 77 22 23 34 140 75 35 76 28 29 71" You say "Notice the oddity with 141?" Riverful says "It has colons on both sides?" You say "It's 141:: Aye." You say "If we look at the first(get(me/xc)) you can see that removing the _'s gives: 22 23 . . . . 139 140 141::" You say "So, what happenned was that 141:: was treated as a valid choice, and so it has 2 colons appended to it." Diane has arrived. Diane enters from the Quad. 011 bows to Diane Diane says "Hi" Mark_Farrell smiles at Diane. "Come to join the code lecture?" Diane stands before you in black standard uniform with mustard collars and shoulders. She has a pip on her collar.. She has long blond hair, and deep blue eyes that follow you around the room. She stands about 5'4" Carrying: Diane's Federation Insignia v3.0U Diane says "Hmmmm, I guess. :)" Diane says "I can use the help with coding. :)" *Mark_Farrell* Time : Fri Oct 13 19:45:57 1995, Stardate : 95781.8 19:45:57 Mark_Farrell nods. "Take a seat and listen in. We're talking some intermediate code, but ask if there's something you want going over." Kramton (ktn) pages: Im back...I gotta a different coding quieting Diane nods Kramton (ktn) pages: er question Diane takes a seat. You whisper-posed Kramton with "Mark_Farrell nods. I'm still lecturing. Can it wait?". Kramton (ktn) pages: sure. You say "Okay, the WiP is the coding example I'm working through. It's a poker table." Mark_Farrell grins. "Well, it will be." Mark_Farrell returns to the discussion of wip/ve. The final thing it does is the same again, but to the remainder from xd and stores it in xe. Mandor has arrived. Mandor enters from the Quad. You say "So, if we look at xe after doing that command, the result is: : 70 36 139: 33 65 44 26 138 40 69 68 131 25" Mandor nods and sit's You say "talking the 'rest()' of the registers xb, xc, xd and xe we can get a properly shuffled deck by just joining them together." You say "You follow?" Riverful says "Yes..." Mark_Farrell nods. "So, the final thing that needs doing is @xf me=[rest(get(me/xb))] [rest(get(me/xc))] [rest(get(me/xd))] [rest(get(me/xe))] Xf:21 19 72 18 39 130 74 133 24 132 43 137 17 66 134 38 41 67 73 20 45 136 27 42 37 135 141:: 129 77 22 23 34 140 75 35 76 28 29 71 70 36 139: 33 65 44 26 138 40 69 68 131 25 Saving TrekMUSE DataBase. Response will be slow for a few minutes. You say "Okay, after doing that, XF: 21 19 72 18 39 130 74 133 24 132 43 137 17 66 134 38 41 67 73 20 45 136 27 42 37 135 141:: 129 77 22 23 34 140 75 35 76 28 29 71 70 36 139: 33 65 44 26 138 40 69 68 131 25" You say "We still have than annoying problem with the extra colons." You say "Suggestions for removing it?" Diane has disconnected. You say "Hints towards 'mid(), pos(), edit(), remove(), replace()'" 011 says "Edit would handle it rather easily" Mark_Farrell nods. Mandor thinks for a moment You say "edit(get(me.xf,:,spc(1)) should replace the : with a space." You say "edit(get(me/xf),:,spc(1)) should replace the : with a space." Mark_Farrell demonstrates using @xg wip=[edit(get(wip/xe),:,spc(1))] Mark_Farrell means of course, xf, not xe. Xg:[edit(get(wip/xf),:,spc(1))] Xg:21 19 72 18 39 130 74 133 24 132 43 137 17 66 134 38 41 67 73 20 45 136 27 42 37 135 141 129 77 22 23 34 140 75 35 76 28 29 71 70 36 139 33 65 44 26 138 40 69 68 131 25 You say "That gives XG: 21 19 72 18 39 130 74 133 24 132 43 137 17 66 134 38 41 67 73 20 45 136 27 42 37 135 141 129 77 22 23 34 140 75 35 76 28 29 71 70 36 139 33 65 44 26 138 40 69 68 131 25" You say "So, we have achieved a shuffled list of numbers greater than 17 items long." 011 cheers You say "Okay. Any questions about _any_ of the things I talked about this last 2 hours." Mandor smiles You say "Anything you are not sure about, or didn't quite follow." Riverful says "Nothing I can remember..." 011 is ok Mark_Farrell nods. "Okay. Now, I'm going to draw to a close, and leave you with this thought. You say "The method we are using to shuffle the cards is simple, and direct. However, the way we do it now uses a lot of registers as temporary storage." You say "Homework is to try to come up with a better way to do this shuffle." 011 smiles You say "I'll leave the code available on 'examine #126/ve'" Mandor smiles and knows...how to do it in C++....:) Ve:$shuffle:new deck;@xb me=[shuffle(get(me/xa),13)];@xc me=[shuffle(de_(first(get(me/xb))),13)];@xd me=[shuffle(de_(first(get(me/xc))),13)];@xe me=[shuffle(de_(first(get(me/xd))),13)] Riverful gets up and stretches a bit. 011 thanks Mark_Farrell for the lecture and heads back to the hospital to check on his mate and child 011 leaves the Auditorium. 011 has left. Mark_Farrell smiles. Mandor says "Well Mark...another good session?" Riverful says "Thanks Mark for this lecture." Mark_Farrell puts something easy to finnd into his logs :-) You say "No problem Arnie. I hope you found it useful. I'll get the other logs to you soon." Riverful says "Allright. Thanks. See you around." Riverful waves. Riverful leaves the Auditorium. Riverful has left. You say "Aye. We did some more fairly useful stuff. Introduced some more functions and more imporantly some of the considerations in deciding how to code things." Mandor says "Well Mark Im glad you are doing this" Taken. Mark_Farrell smiles. "I think it's a good use of my time. Mandor says "Sure is"