The doors part so you can enter the Auditorium. 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: Kremmin Final Test Section Obvious exits: Out Mark_Farrell shrugs. Kremmin waves. You say "AFter I went to soo much trouble to hookup :-)" Kremmin chuckles, "You know cadets... last minute kinda guys." Flag set. Greeter has left. Greeter has arrived. Dropped. Kremmin says "Hello, Greeter" Greeter says ""Hello, Kremmin. how are you?"" Kremmin woooos!!! Mark_Farrell grins. Kremmin smiles, "See what I mean? Last minute." Mark_Farrell nods. 011_and_101 has arrived. 011_and_101 enters from the Quad. Datum has arrived. Datum enters from the Quad. Sir_Isaac has arrived. Sir_Isaac enters from the Quad. *Mark_Farrell* The holoimage on Mark Farrell greets you all. 011_and_101 snap to attention Sir_Isaac stands at attention... Kremmin says "At ease everyone." 011_and_101 relax Sir_Isaac says "Aye, sir." Sir_Isaac takes a seat... 011_and_101 sit down Datum begins to snap, but turns back at Mark's reply. Datum takes a seat. Jomah has arrived. Jomah enters from the Quad. 011_and_101 leave for a quick trip to the bathroom. 011_and_101 leaves the Auditorium. 011_and_101 has left. Nesbitt has arrived. Nesbitt enters from the Quad. Mark_Farrell smiles. "I'm glad you could all make it. In this lecture I plan to build on the material I covered last week. 011_and_101 has arrived. 011_and_101 enters from the Quad. You say "Alright, how many of you haven't coded before?" 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: 011_and_101 Nesbitt Jomah Sir_Isaac Datum Greeter(#126v) Kremmin Final Test Section Obvious exits: Out Jomah raises his hand Nesbitt raises hand 011_and_101 dropped Thingy. Sir_Isaac raises his hand... "Dabbled in it, sir." Datum says "I've had some experience." 011_and_101 were here last class You say "Alright, some of what I say may be a little complex, as I'm going to be builing on the lecture I gave last week. The log is available via email if you want to +mail me your address." Kremmin is reasonably experienced. :) Sir_Isaac smiles Mark_Farrell smiles at the Binars. "Aye, and I'm glad to see I didn't bore you silly last week." 011_and_101 smile You say "To recap the material I covered last week. I introduced some terminology, some aspects of security, and then started to build an example." Mark_Farrell points to Greeter. Nesbitt rises quietly to leave for class Nesbitt leaves the Auditorium. Nesbitt has left. You sense you have new mail from Sir_Isaac. You say "This week, I'm going to expand the code, and cover some of the interactions that you see commonly in code." Greeter(#126v) Owner: Mark_Farrell Credits: 1 Status: Thing Org: None(#-1) Type: Thing Flags: visible Race:Mechanoid Va:!* says "Hello, Greeter":say "Hello, %0. how are you?" Home: Ready Room Location: Carlin Auditorium You say "If you 'examine Greeter' you'll see it has a simple command in the va register." You say "Hello, Greeter" Greeter says ""Hello, Mark_Farrell. how are you?"" Datum says "Hello, Greeter" Greeter says ""Hello, Datum. how are you?"" 011_and_101 nod *Kremmin* Elvis_Presley says "Hello, Greeter" Greeter says ""Hello, Elvis_Presley. how are you?"" Kremmin grins sheepishly, "Sorry." Mark_Farrell smiles. "Okay, so it's not particularly interesting, or useful." M'Ceepy has arrived. M'Ceepy enters from the Quad. You say "Say, for instance we want to add some extra functions to allow us to see the rank of the person saying hello, or to check it's a real player." Datum has disconnected. You say "So, I'm going to introduce two new functions - rank() and num()." You whisper "Time: Fri Oct 6 18:18:53 1995" to Mark_Farrell. Mark_Farrell whispers "Time: Fri Oct 6 18:18:53 1995" You say "Examine greeter, and you can see the nested functions for returning the class of the plater." 011_and_101 says "Hello, Greeter" Greeter says ""Hello, Cadet 011_and_101. How are you?"" Sir_Isaac nods... 'I see...' 011_and_101 nod Mark_Farrell smiles. "Player. class() is comparable to rank(), except that it returns the title of the object specified Tester(#21214) created. Dropped. Flag set. Tester says ""Hello, Greeter" Tester says "Hello, Greeter" Greeter says ""Hello, Thing Tester. How are you?"" You say "Tester is another object - and as you can see, it has class 'Thing'" Vj:$ETA * *:@pe me=ETA of [v(0)] units at warp [v(1)] is approximately [round(fdiv(fdiv(v(0),fmul(fmul(v(1),v(1)),v(1))),30))] minutes or [round(fmul(fdiv(v(0),fmul(fmul(v(1),v(1)),v(1))),2))] seconds. Mark_Farrell sets a bigger command onto greeter/vb Sir_Isaac notices double quotes... You say "Aye. The first time I caused Tester to say hello, I added an extra ". Notice that it then doesn't match the pattern in the ! command, and so nothing happenned." 011_and_101 nod Sir_Isaac says "Interesting, it acted almost like an amplifier..." Greeter says "ETA of 50000 units at warp 5 is approximately 13 minutes or 800 seconds." *Mark_Farrell* ETA of 50000 units at warp 5 is approximately 13 minutes or 800 seconds. Mark_Farrell types just 'eta 50000 5', and the command on greeter/vb caused the output. 011_and_101 nod You say "Things to notice. 1. I didn't say 'eta 50000 5' and 2. The ! is a $" Greeter says "ETA of 750000 units at warp 8.274 is approximately 44 minutes or 2648 seconds." Greeter says "ETA of 39444 units at warp 4.3 is approximately 17 minutes or 992 seconds." Greeter says "ETA of 1500000 units at warp 7.89 is approximately 102 minutes or 6108 seconds." You say "Okay, so we should all see how you can add commands to the objects you add, such a 'press button' and so on now." You say "You use a similar method to matching speech, but a $ instead of a !." 011_and_101 nod You say "You probably noticed lots of square brackets, and I haven't covered where these are needed yet." Norm has arrived. Norm enters from the Quad. You say "From the two examples, you can see that they appear around functions, and they are used by the parser to identify when the coder means a function, and when you just mean plain text." Norm sits down, and is sorry he is late You say "Let me remove them brackets from the ETA command on Greeter..." Sir_Isaac prepares for the onslaught... Greeter says "ETA of 10000 units at warp 5 is approximately 3 minutes or round(fmul(fdiv(v(0),fmul(fmul(v(1),v(1)),v(1))),2)) seconds." *Mark_Farrell* ETA of 10000 units at warp 5 is approximately 3 minutes or 160 seconds. Norm says "yuck" You say "I only removed the final pair around the last set of functions." You say "If you examine Greeter/vb you can see that." M'Ceepy leaves the Auditorium. M'Ceepy has left. You say "There are two exceptions to needing square brackets, and I'll cover them now." Norm will be back Norm leaves the Auditorium. Norm has left. You say "The first is for the test immediately following an @ command, and the second, immediately following the first = sign." You say "The first is for the text immediately following an @ command, and the second, immediately following the first = sign." 011_and_101 nod Plant has arrived. Plant enters from the Quad. Flag set. Flag set. Greeter>> @emit add(1,2) Greeter> Permission denied. Plant leaves the Auditorium. Plant has left. Greeter>> @pemit #16055=add(1,2) Greeter> Permission denied Flag set. Greeter>> @pemit #16055=add(1,2) *Greeter(Mark_Farrell)* 3 Greeter> Mark_Farrell(#16055PDeoqFc) just saw "*Greeter(Mark_Farrell)* 3". You say "Okay, 'examine greeter/vc'" You say "Typing 'brackets" Greeter>> @pemit #707=add(1,2) Greeter> Permission denied Greeter>> @pemit #9592=add(1,2) Greeter> Permission denied Norm has arrived. Norm enters from the Quad. You say "Typing 'brackets' causes the command to be evaluated, and 3 to be emitted to you." Greeter(#126pDvI) Owner: Mark_Farrell Credits: 1 Status: Thing Org: None(#-1) Type: Thing Flags: puppet dark visible inherit Race:Mechanoid Va:!* says "Hello, Greeter":say "Hello, [class(v(#))] %0. How are you?" Vb:$ETA * *:@pe me=ETA of [v(0)] units at warp [v(1)] is approximately [round(fdiv(fdiv(v(0),fmul(fmul(v(1),v(1)),v(1))),30))] minutes or [round(fmul(fdiv(v(0),fmul(fmul(v(1),v(1)),v(1))),2))] seconds. Vj:$ETA * *:say ETA of [v(0)] units at warp [v(1)] is approximately [round(fdiv(fdiv(v(0),fmul(fmul(v(1),v(1)),v(1))),30))] minutes or round(fmul(fdiv(v(0),fmul(fmul(v(1),v(1)),v(1))),2)) seconds. Vc:$brackets:@pemit %#=add(1,2) It:#9592 Home: Ready Room Location: Carlin Auditorium Greeter>> @pemit #11651=add(1,2) Greeter> Permission denied Greeter>> @pemit #15777=add(1,2) Greeter> Permission denied Norm discreetly takes a seet *Kremmin* Kremmin's lag jumps up and carries him screaming off to idle land. :( Greeter>> @pemit #707=add(1,2) Greeter> Permission denied You say "Does everyone see that?" Sir_Isaac nods 011_and_101 nod Kremmin shakes his head. Sir_Isaac's Insignia crackles with Sir_Isaac's voice: brackets Sir_Isaac taps his insignia and says "brackets" Norm must leave again, sorry Norm leaves the Auditorium. Norm has left. Sir_Isaac says "DOH!!" Greeter>> @pemit #11651=add(1,2) Greeter> Permission denied You say "Richard?" 011_and_101 smile Greeter>> @pemit #11651=add(1,2) Greeter> Permission denied Kremmin says "It's accepting the command, but I'm not getting the result." Jomah is owned by Jomah Sex:Male Race:Human Last:Fri Oct 6 17:43:04 1995 Alias:Jom 011_and_101 aren't either Jomah shrugs Mark_Farrell nods. "Okay, here I get to cover spoofing as it rears it's ugly head." You say "There are restrictions on what you can emit to someone else." Kremmin says "Ahh, '3' is the alias for a Klingon called Klaa." 011_and_101 nod You say "These include other players names, and aliases, and also appears to include the number '3' at the moment." Sir_Isaac realizes this could be a problem... :) Mark_Farrell smiles. "Aye. It's done to prevent, for example, me emitting 'Sir_Isaac walks over and switches off the holoprojector' Jomah excuses himself quietly and leaves Jomah leaves the Auditorium. Jomah has left. You say "However, there is a power that you gain as you rise in rank that lets you 'spoof'." You say "It is assumed that by the time you reach high rank, that you'll respect the other players." *011_and_101* 011 nods. Kremmin note this may be a good juncture to mention the nospoof flag. You say "It is probably is good time to mention flags now, and nospoof inparticular." Mark_Farrell chuckles as Richard preempts him :-) You say "Nospoof is a flag that you can set on yourself so that anything emitted is prefixed by the emitter's name, surrounded by *'s." You say "So, if you all '@set me=nospoof'..." *011_and_101* 101 raises her hand. You say "Go ahead..." *011_and_101* 101 asks "Is this the default for players?" Sir_Isaac was wondering the same Kremmin nods. You say "I'm not sure it is. It was introduced after I joined, and I had to set it explicitly." You say "You have is set already?" Greeter>> @pemit #9592=add(1,2) Greeter> Permission denied 011_and_101 have many times :) Vc:$brackets:@pemit %#=add(1,2) Mark_Farrell smiles. Kremmin notes his nospoof flag was set by default, it was the first flag he reset (it gets kinda annoying). You say "Alright, you have probably noticed that it messes up some of the displays on the objects at the Academy." You say "You can @set me=!nospoof to turn it off." Riverful has arrived. Riverful enters from the Quad. You whisper "Will you try 'brackets' for me." to Kremmin. Greeter>> @pemit #707=add(76,2) Greeter> Kremmin just saw "78". Riverful leaves the Auditorium. Riverful has left. You say "Okay, so back to the topic of brackets." *Kremmin* Yup, it responds with 78. Greeter>> @pemit #9592=add(76,2) Greeter> Sir_Isaac just saw "78". You say "I've changed the add() if greeter/vc to return a different number, and you should all see that operating now." You whisper "You can whisper back at me now btw, I unhid." to Kremmin. Sir_Isaac nods You say "Okay. Having shown you that, I'm going to recommend that you always put the brackets in." Kremmin nods and smiles. Mark_Farrell modifies greeter/vc to have a second add command after the first one. Greeter>> @pemit #16055=add(76,2) add(76,2) *Greeter(Mark_Farrell)* 78 Greeter> Mark_Farrell(#16055PDeoqFc) just saw "*Greeter(Mark_Farrell)* 78". Greeter>> @pemit #9592=add(76,2) add(76,2) Greeter> Sir_Isaac just saw "78". You say "So, it is now: @vc greeter=$brackets:@pemit #16055=add(76,2) add(76,2)" Greeter>> @pemit #15777=add(76,2) add(76,2) Greeter> 011_and_101 just saw "*Greeter(Mark_Farrell)* 78". 011_and_101 nod Greeter>> @pemit #9592=add(76,2) add(76,2) Greeter> Sir_Isaac just saw "78". You say "You would probably expect this to do both? Or to return '78 add(76,2)' if the second word it treated as plain text." You say "However, that actual result is just '78'" Greeter>> @pemit #707=add(76,2) add(76,2) Greeter> Kremmin just saw "78". *Mark_Farrell* Cadet 011_and_101 is looking at you. Mark_Farrell smiles. "now, to my mind, that's counter-intuitive. Sir_Isaac's 's mind feels it's counter-intuitive too... You say "It is also easily avoided by surrounding both by square brackets." 011_and_101 only understand binary.. Greeter>> @pemit #16055=78 78 *Greeter(Mark_Farrell)* 78 78 Greeter> Mark_Farrell(#16055PDeoqFc) just saw "*Greeter(Mark_Farrell)* 78 78". Mark_Farrell smiles. "I'm sorry, thats 1001100 in binary. 011_and_101 smile Mark_Farrell finishes changing the code on vc and sees '78 78' as the result. Greeter>> @pemit #707=78 78 Greeter> Kremmin just saw "78 78". 011_and_101 nod Greeter>> @pemit #15777=78 78 Greeter> 011_and_101 just saw "*Greeter(Mark_Farrell)* 78 78". You say "Okay. Brackets bring up another issue here." Greeter>> @pemit #9592=78 78 Greeter> Sir_Isaac just saw "78 78". Sir_Isaac raised his hand... You say "Isaac..." Sir_Isaac says "Sir, it may seem like an idiotic question, but where did the space bt/wn the two results come from?" You say "If you look at greeter/vc, you'll see that I left a space between the two sets of square prackets." You say "Brackets, even." Sir_Isaac says "So it interperated the space as normal text... thank you, sir." You say "That is what causes the space to appear. If the code was [add(76,2)][add(76,2)] it would print 7878. That's right. The space is treated as normal text." You say "You could put and normal text inbeween." Sir_Isaac says "The reason for the brackets in the first place..." You say "any. " Sir_Isaac loves the cyclic nature of thought... You say "The brackets cause the parser to treat the text inside them as a function." Mark_Farrell grins. Kremmin prefers the thoughtful nature of cycling. ;) 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: Tester(#21214v) 011_and_101 Sir_Isaac Greeter(#126pDvI) Kremmin Final Test Section Obvious exits: Out Mark_Farrell smiles. Sir_Isaac also prefers the reverse... :) 011_and_101 dropped Poker Deck. Poker Deck(#12295vI) You see nothing special. Poker Deck(#12295vI) Owner: 011_and_101 Credits: 1 Status: Thing Org: None(#-1) Type: Thing Flags: visible inherit It:#12295 Vh:$POP:@edit po/vf=of,@;@edit po/vf=$,spc(1);@edit po/vf=$,{[strcat(extract(v(vb),add(rand(13),1),1),extract(v(va),add(rand(4),1),1))]} Va:_Spades _Hearts _Diamonds _Clubs Vc:$DEAL:@edit po/vf=$,spc(1);@edit po/vf=$,{[strcat(extract(v(vb),add(rand(13),1),1),extract(v(va),add(rand(4),1),1))]} Vb:Two_of Three_of Four_of Five_of Six_of Seven_of Eight_of Nine_of Ten_of Jack_of Queen_of King_of Ace_of Vd: Jack_of_Spades Vg:$TIP:say match(v(vd),first(v(vf))) Vf: Nine_of_Hearts Six_of_Hearts Home: 001 Location: Carlin Auditorium You say "Ah ha. Work in progress, 011?" 011_and_101 nod 011_and_101 tried and failed at it :( You say "Okay. Let me just say a coule more things about when functions are evaluated, and then we can come on at look at the poker deck." 011_and_101 smile Tester shakes and starts to crumble Okay, Tester(#21214Gv) will go away in 0s. Sir_Isaac sweeps away the ashes, and resumes his seat... You say "The issue is when does this function parsing happen? As I'll show in a later lecture it's vital to grasp this to code 'good' objects." You say "Well, the easy answer is when the commands are put into the queue." You say "The game has a queue of @commands waiting to be processed, and when you type 'brackets', the game sees that it matches the pattern on Greeter, and puts the command onto the Q." 011_and_101 nod You say "When the command gets to the top of the queue, Greeter will actually do the pemit." Sir_Isaac sees.. You say "Hence, the term 'q-lag' - the time to go from the bottom to the top of the queue." Saving TrekMUSE DataBase. Response will be slow for a few minutes. You say "This is obviously dependant on the number of @commands in there, so bear that in mind when you are coding. Try to think of ways to make an object do what you want with the fewest number of @command you can." Riverful has arrived. Riverful enters from the Quad. Sir_Isaac raises hi hand.. Jomah has arrived. Jomah enters from the Quad. Kremmin says "And avoid @switch and @force like poison..." Jomah leaves the Auditorium. Jomah has left. Mark_Farrell nods at Isaac. "Go ahead." Sir_Isaac says "Sir, is it possible for an 'extra important object' to be listed in the queue several times to speed up the process? (Not that I would have to ever code any such objects...)" You say "Well, every player has a limit to the number of items they can have in the queue." You say "Generally (I seem to remember) the limit is 50." Kremmin nods, "It's 50, I've bounced of it a couple of times." Sir_Isaac will never even get close to exceeding that... You say "When you reach the limit, all your objects are @set haven, and will not respond to any pattern matching." Riverful leaves the Auditorium. Riverful has left. You say "If (heaven forbid) you need more than that, you can ask a director for a special change, and the request will be looked at on its merits." You say "Does that cover you question, Isaac?" Sir_Isaac says "Yes, sir. Thank you." You say "Okay, just to make life more interesting, some commands cause the string to be parsed more than once." Kremmin grumbles. You say "Generally - @pemit, @switch, @dolist, @foreach (use @dolist instead of @foreach)." You say "The most common cause of complaints is if you are using the text formatting commands." You say "Every time a string is passed through the parser, any multiple-spaces are replaced with a simgle one." Sir_Isaac noticed that earilier today... 011_and_101 nod You say "It also removes any carraige returns, and you have probably been told to use %R for those." You say "%%R" You say "Adding a % before a [ or another % causes it not to be parsed on that time through the parser." You say "So, in an @pemit %%R, when the command if put into the queue, it has been parsed once, and reads: @pemit %R" You say "Then then is is executed, is is parsed again, and the output is a CR" 011_and_101 nod Sir_Isaac sees now... Mark_Farrell is simplifying the points here, and will cover delaying more later. Sir_Isaac says "So, if you wanted to retain multiple spaces... a % must be used before each one?" 011_and_101 says "or just use spc()" You say "Well, that is one solution. A better one is to use the spc() function." 011_and_101 smile You say "For instance, @emit Hello %[spc(10)] There!" You say "For instance, @emit Hello %[spc(10)%%] There!" Sir_Isaac says "Thank you, sir." Mark_Farrell gets it right eventually...: @emit Hello %[spc(10)%] There! You say "when it is put on the queue: @emit Hello There!" You say "And when it is parsed again, the spc(10) becomes 10 spaces (plus the two either side, making 12)" You say "when it is put on the queue: @emit Hello [spc(10)] There!" Mark_Farrell notes that 'say' does fun things too, and trying to 'talk' code can be a pain in the neck sometimes. You say "So, is that as clear as mud for you now?" Sir_Isaac says "Yes, sir... :)" 011_and_101 smile Sir_Isaac really ought to be quiet so as to keep the meeting on track... Mark_Farrell smiles and recaps. "The main point is to remember about stripping spaces and carraige returns, and that you can delay to fix that." Sir_Isaac nods You say "Well, you're bringing up good points, and I'm sure 011 and 101 don't mind." 011_and_101 nod. Good points indeed. Sir_Isaac says "Thank you." Mark_Farrell remembers this week to plug 'help tutorials' if you don't know about them already. Sir_Isaac remembers hearing about that... "I'll look into them, sir. 011_and_101 have read some of them... there are a lot :) You say "I'm covering the material in those in probably a more haphazzard way than in the tutorials, and they are probably a good place to pick up the basics from." Mark_Farrell smiles. "AYe. And here is the place for you to address problems. You say "I think I've covered enough that we can take a reasonable eye over the poker table now, and to move it forward." 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: Poker Deck(#12295vI) 011_and_101 Sir_Isaac Greeter(#126pDvI) Kremmin Final Test Section Obvious exits: Out 011_and_101 raise the poker deck 011_and_101 didn't get terribly far, so it should be a good tutorial tool You say "Just before we do, are there any questions you have on anything I've said today." Sir_Isaac says "No, sir, I've already exhausted them... :)" 011_and_101 smile Mark_Farrell feels he's flown between lots of topics in a fairly random order. "Alright them. Lets press on." You say "So, let's think for a minute what we need the poker table to do." *011_and_101* 101 raises her hand. You say "101, would you like to explain your thoughts on this..." *011_and_101* 101 says "First off it needs to deal... " Mark_Farrell nods. You whisper "Run though the whole list." to 011_and_101. 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: Poker Deck(#12295vI) 011_and_101 Sir_Isaac Greeter(#126pDvI) Kremmin Final Test Section Obvious exits: Out 011_and_101 whispers "Was trying to get the basics down on it first :) Shall we own it to you?" You say "Hold onto it for now." 011_and_101 nod You say "Let's run through the full list." 011_and_101 says "What has been already done may be examined(it is visible)" You whisper "Time: Fri Oct 6 19:27:12 1995" to Mark_Farrell. Mark_Farrell whispers "Time: Fri Oct 6 19:27:12 1995" 011_and_101 nod You say "We should start by thinking about where we want to take it eventually, and them break it down." 011_and_101 says "When dealing, it needs to remember which cards have been taken." Sir_Isaac could think of some more frivelous ones... Mark_Farrell smiles. You say "So, deal, play, win, bet, and so on." 011_and_101 nod Sir_Isaac nods You say "Each one being a fairly complex issue in its own right." 011_and_101 have noticed..... :) You say "Okay, so, those are what the players (more than 1!) will" You say "do. More basic than that is the _how_ we decide to store the cards." 011_and_101 nod Sir_Isaac can imagine many ways You say "We have some choices to make here." You say "Do we just store a list of names? A list of numbers? A list of suits and values?" 011_and_101 realize that names would take too much space. You say "Right." Sir_Isaac thinks we could combine suits and numbers for the proper result You say "So we come down to numbers. How we number is going to affect how easy it is to decide who wins, and who loses." Mark_Farrell nods. 011_and_101 ahh You say "The wrong decision now could make automating that step difficult, or impossible." 011_and_101 raise hands. You say "Shoot." 011_and_101 says "Could not the number be simply derived from placement in a list(s)?" Mark_Farrell nods. "Yes it can." You say "However, for this example, I'm going to decide to number the cards from 2 to 14, to correspond to 2 through K Q K A" 011_and_101 nod You say "We are going to assume Aces are high." You say "Suits also have an effect." Sir_Isaac has disconnected. Sir_Isaac has connected. Sir_Isaac apologises Sir_Isaac You whisper "Where's the last thing you saw?" to Sir_Isaac. 011_and_101 nod: Spades, Hearts, Diamonds, Clubs Sir_Isaac says "I got up to number storage..." Mark_Farrell nods and recaps a bit. Sir_Isaac curses the phone company's bellow par lines... You say "Well, you didn't miss anything them :-)" Sir_Isaac :) You say "Okay. So, we have two choices. We can use a binary encoding for the suits, for ease of checking later." You say "Of we can number 2-14, 16-28 etc" You say "What I have in mind (Binar's will love this) is:" Sir_Isaac expects the answer... You say "In binary: SHDCxxxx, where xxxx is the card number in binary, and the bits at the top flag the suit." 011_and_101 nod Sir_Isaac prefers this method also... "Got me out of a number of other prog lang crunches..." You say "Okay. We may have some problems with this too later, but lets leave it like this for now." You say "Recap: We now have a list of 52 numbers (no jokers provided for) that represent the cards." You say "We need some function for converting the number into a card name that the player will understand." You say "Okay. Time to introduce my favourite function on the muse. U()." You say "Before I do that, let's consider some other points." Mark_Farrell clears the codes from Greeter, and renames it WorkInProgress using @name. Greeter is now known as WorkInProgress. Name set. You say "Say we want to display "The Two of Hearts" given the string 01000010" You say "How are we going to do it?" Sir_Isaac thinks... *011_and_101* 011 riases his hand You say "011" 011_and_101 says "First, we have to get the number.... rnd()? But then how do you get a number where the first four bits have only one of them on?" You say "Okay, read 'help mid()'" 011_and_101 nod You say "We can use mid() two break this into two parts. 0100 and 0010" 011_and_101 nod Sir_Isaac says "And then rebond and unbod them as we wish... I see..." Sir_Isaac says "unbond, even." You say "Now, the choice here is do we think that storing them together like this is going to save us effort in the long run, given that we have to keep breaking them up?" Sir_Isaac ponders... band(,) Arguments: 2 Type: Logical Returns the bit-wise and of and . What's a bit-wise and? Well, each integer is translated into it's binary equivalent (i.e. 1001 and 1100) and then the individual bits (1s and 0s) are compared one by one. If the bits in the same position in both binary numbers are *both* true(1), then that bit is set to 1. If they are not *both* true(1), then the bit is set to 0. Then, the resulting binary number is re-translated into an integer. Wierd, huh? If you find a use, tell me. Example: band(15,45) = 13 * See also: bor(), bnot() Sir_Isaac says "Depending on the rest of the code, it may be more efficient or less efficient." Mark_Farrell smiles. You say "Okay. Well, we'll stick with it for now, and see what happens." You say "So, If we use mid() we get the string 0010 back for the card number." 011_and_101 nod You say "What do we do with it then?" Sir_Isaac says "Match it to a corresponding English statement?" Mark_Farrell nods. 011_and_101 agreees You say "Okay, read 'help lookup' and 'help lookin'" Sir_Isaac assimilates the info, although slowly... Kremmin is on channel FMO. Fed_Merchants is on channel FMO. Mark_Farrell(#16055PDeoqFc) is on channel FMO. --- FMO --- Mark_Farrell will lead you through an example. 011_and_101 were using extract() Mark_Farrell tinkers with WorkInProgress Sir_Isaac is more confused at the completion of his reading... WorkInProgress>> @emit The value is . *WorkInProgress(Mark_Farrell)* The value is . You say "Examine the workinprogress" Mark_Farrell renames it WiP Huh? (Type "help" for help.) WorkInProgress is now known as WiP. Name set. WiP>> @emit The value is One. *WiP(Mark_Farrell)* The value is One. Sir_Isaac says "Sure, right after I type in the long string... :)" WiP>> @emit The value is . *WiP(Mark_Farrell)* The value is . You say "It I type 'test 1', then it looks in vb for something matching '1' and then into vc for the text." WiP>> @emit The value is Two. *WiP(Mark_Farrell)* The value is Two. WiP>> @emit The value is Two. *WiP(Mark_Farrell)* The value is Two. I don't see work here. Sir_Isaac says "Fascinating..." 011_and_101 ahhh I don't see work here. 011_and_101 says "indeed" Sir_Isaac is begining to comprehend WiP>> @emit The value is Four. *WiP(Mark_Farrell)* The value is Four. Sir_Isaac says "What did you type to extract four?" WiP>> @emit > Mark_Farrell types 4. The value returned is Four. *WiP(Mark_Farrell)* > Mark_Farrell types 4. The value returned is Four. WiP>> @emit > Mark_Farrell types 5. The value returned is Five. *WiP(Mark_Farrell)* > Mark_Farrell types 5. The value returned is Five. WiP>> @emit > Sir_Isaac types 2. The value returned is Two. *WiP(Mark_Farrell)* > Sir_Isaac types 2. The value returned is Two. WiP>> @emit > 011_and_101 types 1. The value returned is One. *WiP(Mark_Farrell)* > 011_and_101 types 1. The value returned is One. You say "Let me explain how the code works...." Saving TrekMUSE DataBase. Response will be slow for a few minutes. You say "$test *:@emit > %N types %0. The value returned is [lookup(v(vc),v(vb),v(0),0)]." 011_and_101 think they understandd,, barely Sir_Isaac is still on the twilight zone of understanding... You say "The Mark_Farrell is the enactors name - Mark_FArrell, 011_and_101, Isaac etc." You say "The %N is the enactors name - Mark_FArrell, 011_and_101, Isaac etc." Mark_Farrell notes the > is just so he doesn't get caught out by spoofing. 011_and_101 ahh WiP>> @emit > 011_and_101 types 3. The value returned is Three. *WiP(Mark_Farrell)* > 011_and_101 types 3. The value returned is Three. You say "Now, lets take the lookup apart. Be sure to stop me if I say something you are not clear about." Sir_Isaac steps into the area of understanding, from the twilight zone, with some help from the genious that is Mark_Farrell... You say "$test *: means that %0 is whatever we type after 'test'. Now, from last week, we should remember that %0 is the same as [v(0)]." Sir_Isaac remembers, even though he wasn't here... You say "Ie, Stack variable 0 is set to the first thing we match in the pattern." Mark_Farrell nods. Kremmin is on channel FMO. Fed_Merchants is on channel FMO. Mark_Farrell(#16055PDeoqFc) is on channel FMO. --- FMO --- You say "Now, [lookup(v(vc),v(vb),v(0),0)]" Poker Deck says "0" You say "More generally, lookup(A,B,C,D)" Poker Deck says "1 returns Two_of." 011_and_101 smile WiP>> @emit > Kremmin types oof. The value returned is . *WiP(Mark_Farrell)* > Kremmin types oof. The value returned is . You say "Lookup operated by looking for a match between C and B." Poker Deck says "7 returns Eight_of." You say "So, if you type '1', C = 1, and then B is v(vb), which is 1 2 3 4 5 6 7" You say "So, C matches the first entry in B." 011_and_101 nod Sir_Isaac sees... You say "Okay, if it doesn't match, the lookup returns nothing at all." Sir_Isaac realizes this is what happened with 'oof'... Kremmin excuses himself and quietly leaves the auditorium. 011_and_101 nod Kremmin leaves the Auditorium. Kremmin has left. You say "But, if it does, we add D to the position we found - giving us 1 + 0 = 1 again." You say "Then we look in that position in A (v(vc) = One Two.....) and return the word at that point." You say "Okay?" 011_and_101 nod Sir_Isaac thinks he understands.. Sir_Isaac goes back to the examine and understands. You say "So, if I change D to be 1, then 'test 1' would return 'Two' and 'test 4' would return 'Five' and so on." You say "If I made it -1, it would return the previous word." Sir_Isaac says "Ohhh... I see now." 011_and_101 understand *011_and_101* 011 raises a hand. You say "Go for it..." *011_and_101* 011 asks "what is the v(0) for then? You say "The v(0) is the thing we typed after the 'test ??????'. Ie v(0) = ??????" 011_and_101 oh. knew that.. :) You say "v(0) is the same as %0 :-)" 011_and_101 nod You say "I didn't use %0 because the parser does not recognize the %0 shortcut inside square brackets (normally)." You say "you=use" 011_and_101 nod Sir_Isaac nods... You say "So. Lets take the 0010 0011 etc and put them into vb." WiP>> @emit > Mark_Farrell types 0001. The value returned is One. *WiP(Mark_Farrell)* > Mark_Farrell types 0001. The value returned is One. Sir_Isaac says "Ahhh..." Va:$test *:@emit > %N types %0. The value returned is [lookup(v(vc),v(vb),v(0),0)]. Vb:0001 0010 0011 0100 0101 0110 0111 Vc:One Two Three Four Five Six Seven WiP>> @emit > 011_and_101 types 0010. The value returned is Two. *WiP(Mark_Farrell)* > 011_and_101 types 0010. The value returned is Two. You say "Okay, lets go back and think again about how we are storing the cards. " You say "We could store them as decimal (sorry binars) but still use the binary encoding we had above." Sir_Isaac says "How, sir?" You say "Ie, instead of using 01000010 we store 68" Sir_Isaac thinks that'd be one long command chain for a converstion... WiP>> @emit > 011_and_101 types 1010. The value returned is 'The of Something'. *WiP(Mark_Farrell)* > 011_and_101 types 1010. The value returned is 'The of Something'. You say "Now, we can use the band() function to extract the bits we want from the decimal number easily." Poker Deck says "1010 returns Jack_of." Sir_Isaac says "Ahh... I forgot about that... Thank you, sir." 011_and_101 nod You say "For instance: [band(68,15)] = 2" Mark_Farrell is assuming you are both familiar with binary :-) Mark_Farrell oopses. both = three. Sir_Isaac :) 011_and_101 nod Sir_Isaac nods You say "Okay, This makes thinks easier for the naming too." You say "We can go back and use an extract() instead of a lookup()." Sir_Isaac again recognizes the cyclic nature of rational thought. You say "If we use extract(v(vc),band(v(0),15),1) we will have the same result as before, but we are using less complex functions." Mark_Farrell throws an apple at you :-) Kremmin has arrived. Kremmin enters from the Quad. Sir_Isaac discovers gravity... "Wait, that's been a round for a while..." :) Rizon has arrived. Rizon enters from the Quad. You say "Read up on 'help extract()' if you haven't already." Kremmin quietly returns to his seat. Rizon sits down. 011_and_101 have Mark_Farrell tinkers with WiP while you do that. Va:$test *:@emit > %N types %0. The value returned is 'The [lookup(v(vc),v(vb),v(0),0)] of Something'. WiP>> @emit > Mark_Farrell types 68. The value returned is 'The Four of Something'. *WiP(Mark_Farrell)* > Mark_Farrell types 68. The value returned is 'The Four of Something'. Sir_Isaac just finished reading.. WiP>> @emit > 011_and_101 types 40. The value returned is 'The of Something'. *WiP(Mark_Farrell)* > 011_and_101 types 40. The value returned is 'The of Something'. Mark_Farrell smiles. Numbers from 1-7 work. Sir_Isaac wonders why it won't respond to his commands... WiP>> @emit > Kremmin types 6. The value returned is 'The Six of Something'. *WiP(Mark_Farrell)* > Kremmin types 6. The value returned is 'The Six of Something'. WiP>> @emit > 011_and_101 types 3. The value returned is 'The Three of Something'. *WiP(Mark_Farrell)* > 011_and_101 types 3. The value returned is 'The Three of Something'. You say "You are typing just 'test Isaac?" You say "No ' needed..." Sir_Isaac says "Ahh... I neglected th space..." Mark_Farrell nods. WiP>> @emit > Rizon types 5. The value returned is 'The Five of Something'. *WiP(Mark_Farrell)* > Rizon types 5. The value returned is 'The Five of Something'. WiP>> @emit > Sir_Isaac types 6. The value returned is 'The Six of Something'. *WiP(Mark_Farrell)* > Sir_Isaac types 6. The value returned is 'The Six of Something'. Poker Deck says "0110 returns Seven_of." Sir_Isaac says "There she goes..." WiP>> @emit > Mark_Farrell types 1. The value returned is 'The Ace of Something'. *WiP(Mark_Farrell)* > Mark_Farrell types 1. The value returned is 'The Ace of Something'. WiP>> @emit > Mark_Farrell types 12. The value returned is 'The Queen of Something'. *WiP(Mark_Farrell)* > Mark_Farrell types 12. The value returned is 'The Queen of Something'. Mark_Farrell has added to vc the rest of the card face names. Sir_Isaac says "So we could actually add jokers by increasing the code to fall of the extract string?" You say "That's right. If we decided to use 14 as joker, we could just add it to the end." WiP>> @emit > Rizon types 14. The value returned is 'The of Something'. *WiP(Mark_Farrell)* > Rizon types 14. The value returned is 'The of Something'. Mark_Farrell does that now. You say "Try it again Rizon." WiP>> @emit > Rizon types 14. The value returned is 'The Joker of Something'. *WiP(Mark_Farrell)* > Rizon types 14. The value returned is 'The Joker of Something'. Sterling (Gordo) pages: Meeting on? [FMO] Mark_Farrell: Delayed 'til 9pm. [FMO] Sterling nods. 011_and_101 notes the problem of Joker's being of themselves 011_and_101 smile Mark_Farrell smiles. You say "Aye." Sir_Isaac says "IF we re-intill the C variable, the 'of Something' should drop off, right?" Sir_Isaac says "instill, even" Sir_Isaac hates it when he slurs... :) You say "Well, I haven't come to look at the code for that yet." Sir_Isaac says "Wow, from being a little behind the lecture, I jumped ahead, isn't SF wonderful?" Mark_Farrell grins. 011_and_101 Smile Rizon takes notes. You say "Okay. So, Lets code the suit list." Sir_Isaac realizes he didn't start relogging after he got disconnected before... Mark_Farrell has been logging and will make the logs available. Sir_Isaac says "Thank you, sir." WiP>> @emit > Mark_Farrell types 65. The value returned is 'The Ace of Hearts'. *WiP(Mark_Farrell)* > Mark_Farrell types 65. The value returned is 'The Ace of Hearts'. WiP>> @emit > Mark_Farrell types 66. The value returned is 'The Two of Hearts'. *WiP(Mark_Farrell)* > Mark_Farrell types 66. The value returned is 'The Two of Hearts'. WiP>> @emit > Sir_Isaac types 2. The value returned is 'The Two of '. *WiP(Mark_Farrell)* > Sir_Isaac types 2. The value returned is 'The Two of '. WiP>> @emit > Mark_Farrell types 17. The value returned is 'The Ace of Clubs'. *WiP(Mark_Farrell)* > Mark_Farrell types 17. The value returned is 'The Ace of Clubs'. WiP>> @emit > Rizon types 21. The value returned is 'The Five of Clubs'. *WiP(Mark_Farrell)* > Rizon types 21. The value returned is 'The Five of Clubs'. Sir_Isaac says "We could put the joker down in the lower area to drop of the 'of '.." You say "Take a look at wip/va and ask any questions you have." You say "Well, If we use 16+14, we'll get the joker, but with a suit." Sir_Isaac says "Hmmm... how to drop the suit....?" You whisper "Time: Fri Oct 6 20:33:09 1995" to Mark_Farrell. Mark_Farrell whispers "Time: Fri Oct 6 20:33:09 1995" Rizon raises his hand. Sir_Isaac realizes it may not be worth it to put it the darned Joker... 'They always make trouble...' :) WiP>> @emit > Kremmin types 130. The value returned is 'The Two of Spades'. *WiP(Mark_Farrell)* > Kremmin types 130. The value returned is 'The Two of Spades'. You say "your suggestion is a good one, but we need to have some setting for the 'red' and 'black' jokers." You say "Rizon..." Rizon says "wouls err would there be a way to code it to give a more random response?" M'Ceepy has arrived. M'Ceepy enters from the Quad. Mark_Farrell nods. We could code it to used one of a number of output formats. You say "We are aiming for a poker table here though, so for now we can keep it simple." Mark_Farrell nods at MCP. Sir_Isaac was thinking... Mark_Farrell smiles. Sir_Isaac says "We could actually use ASCII art for the output..." Mark_Farrell runs and hides. 011_and_101 smile Sir_Isaac says "Make it look like the top left corners of all the cards, fanned out..." Kremmin eeps. Sir_Isaac thinks he has gone where he shouldn't have... Mark_Farrell grins. "Aye. We could. Rule 1 of muse coding is to keep it small :-)" Rizon looks pux err puzzled at Sir. Sir_Isaac says "Aye, sir..." Sir_Isaac says "Add the frivelous stuff later... or not at all... :)" You say "We could have a problem formatting the output and although the problem isn't insurmountable, as you say, working first, features later :-)" Poker Deck says "54 gives the Function(EXTRACT) only expects 3 arguments of" WiP>> @emit > Sir_Isaac types 54. The value returned is 'The Six of '. *WiP(Mark_Farrell)* > Sir_Isaac types 54. The value returned is 'The Six of '. You say "It never hurts to think about where the game is going though, and to plan ahead." You whisper "48" to Mark_Farrell. Mark_Farrell whispers "48" You say "54 has 2 suit bits set, Isaac." Sir_Isaac says "I typed before I thought..." You say "However, we could use an 'invalid' combination of suit bits to produce the 'joker' output." M'Ceepy grins. Sir_Isaac says "I was thinking along the same lines, sir." Mark_Farrell nods. Sir_Isaac says "Poker just wouldn't be fun w/o the Joker..." Sir_Isaac :) WiP>> @emit > Sir_Isaac types add(128 3. The value returned is 'The of '. *WiP(Mark_Farrell)* > Sir_Isaac types add(128 3. The value returned is 'The of '. Mark_Farrell smiles. "Not forgetting wild cards. I can see that this coding lecture is going to keep me busy til christmas." WiP>> @emit > Sir_Isaac types add(128 3). The value returned is 'The of '. *WiP(Mark_Farrell)* > Sir_Isaac types add(128 3). The value returned is 'The of '. Sir_Isaac hits himself on the head... Mark_Farrell chuckles. '@force me=test [add(128,3)] would work :-) Sir_Isaac says "I must have lost unconciousness there for a sec..." Sir_Isaac says "I mean '...lost conciousness...'" Mark_Farrell grins. You say "Well, I actually have another meeting coming up ay 9pm, so we need to wrap up here soon." Sir_Isaac says "That seems odd, since I usually check the time with 'look time()'..." Poker Deck says "34 gives the Function(EXTRACT) only expects 3 arguments,1" You say "Are there any questions about the code that we have produced today, and the techniques we used." I don't see Fri Oct 6 20:44:57 1995 here. M'Ceepy screams. "Why didn't someone tell me we had bitwise functions?" Mark_Farrell nods. "The parser is fun. Kremmin grins, "You never asked?" Mark_Farrell chuckles at MCP. They are listed in help functions mate. Sir_Isaac shakes his head no... "It was quite an enlightening experience, sir, and I hope to come next week." Whisper-pose: Kremmin laffs. You say "You're most welcome." 011_and_101 agrees Rizon agrees also. You say "If you want the logs, you can +mail me your email addresses, and I'll tidy them up and send them out." 011_and_101 already captured them :) You say "THe week was rather disjointed to start with, but we covered some useful things about arrays, and even managed to show MCP a thing or two :-)" M'Ceepy says "Uh, those functions aren't listed in 'help functions'" You say "Oh?" You say "I'm sure I've seen 'em somewhere..." Sir_Isaac says "Now that doesn't happen too often... :)" M'Ceepy says "Ah, 'help list logical functions'" Kremmin nods. 011_and_101 smile 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: M'Ceepy Rizon Kremmin 011_and_101 Sir_Isaac WiP(#126pDvI) Final Test Section Obvious exits: Out M'Ceepy says "OK, now I can design that granulated security system. :)" 011_and_101 thank Mark_Farrell for his lecture, and leave the room. 011_and_101 goes home. 011_and_101 has left. You say "I'll leave the WiP visible, and if you want to look at it during the week, it's database number is 126. 'examine #126' will do the trick, even if it is not in your location." Mark_Farrell grins at MCP. Sir_Isaac says "Ok, thank you again, sir." Sir_Isaac stands at attention... Sir_Isaac leaves the Auditorium. Sir_Isaac has left. Mark_Farrell's holoimage waves goodnight before winking out.