Friday 17th November 1995 Coding Lecture 7 ---------------- 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: Hollis Final Test Section Obvious exits: Out Mark_Farrell smiles. Dropped. Drakon says "uh oh" Hollis says "what?" Drakon says "oh nothing.. just type ex wip" Drakon says "its a BIG program" Bucket's Memorial has arrived. Drakon dropped Bucket's Memorial. You say "Well, it looks like you are it for today. What do you want me to cover?" Hollis says "holy spock in heaven" Drakon says "hmmmmmm" Hollis says "well I read the book and I was hoping to be walked though a little hands on" John_Penta says "ow,,,,Im in pain...." Rusty has arrived. Rusty enters from the Quad. Drakon says "i tryed typing @Va hoverbot=$b, *:@emit " Drakon says "but it said permission n.. denied to my hoverbot" Drakon says "i want it so taht i don't have to say what i want my bot to do.. to get him to do it" Hoverbot has arrived. Drakon dropped Hoverbot. Rusty says "If I may ask, what is this meeting about...And can I join in???" You say "Well, okay. I'll cover spoofing, and some basic hands on examples." Rusty says "I can fix that" Hollis says "coding" Drakon says "you can view my bots programing to tell me what i did wrong" Mark_Farrell nods at Rusty. "You're most welcome. I hold a weekly lecture/workshop to talk about muse coding." Rusty says "try @va hoverbot=$b *:pose " Bucket's Memorial has left. Drakon lags bucket has arrived. Rusty dropped bucket. You say "Anything else?" Drakon says "i don't want my bot to just pose.. i want him to acctually DO something" Drakon says "so the taxi thing will be easier" You say "Drakon - You need to set the 'bot 'inherit'" Drakon :) Rusty says "Drakon, do you mean like leave the room???" Drakon says "done" Drakon says "ya.. ya know .. like this" Hollis says "I was thinking of a Blade Runner style spinner car. And an improvement to San Francisco" Drakon says "only without the voice command" John_Penta says "TAXI???????" Drakon says "bot, say hi" Hoverbot says "hi" Rusty says "try @va bot=$b, *:" You say "Whenever you create an object, it has no 'powers' to modify, or really do anything until you set it 'inherit'." Drakon says "see.. i have to tell him to say hi.. i would rather just program him to accept commands" Rusty says "try @va bot=$b, *:percent0" John_Penta says "OOC: so this this hoverbot's been stuck in the plant for all eternity....." Rusty says "you know what I mean..." Hollis says "can you create a object you can acutally get into?" John_Penta leaves the Auditorium. John_Penta has left. Rusty says "type enter object" You say "Rusty - Drakon's command will work. The 'bot just needs to be set inherit." Hoverbot says "hi" Drakon says "there.. thanx" Rusty says "Oh, I set myself inherit so I wouldnt have to worry about that..." Drakon says "rustys command works too" Mark_Farrell nods. Rusty says "watch:::" bucket has left. Hoverbot waves Rusty says "I didnt pick him up..." You say "More or less the first rule of coding it to set the object inherit, unless it is just a data storage object." Drakon says "this it.. is gra.. rrr.. great" Rusty says "He entered me" Drakon says "ok then.. thanx" bucket has arrived. Rusty says "you might like this too..." Drakon morphs into a vest Drakon is now known as Vest. Hollis says "is there any other sources of info besides the manual from the web site?" Mark_Farrell nods. Hoverbot puts the vest on Vest has left. Hollis says "where?" You say "Try ftp://sparc2.umeres.maine.edu/pub/" bucket has left. Hoverbot says "i am wearing my master.. hehe" You say "Or ftp://eeunix.ee.usm.maine.edu/pub/virtreality/" Rusty has left. Hoverbot takes off the vest Vest has arrived. Hoverbot dropped Vest. Hollis says "would I be better off doing some coding on my own first" Vest morphs into Drakon Vest is now known as Drakon. Rusty has arrived. Rusty says "why did you change your name???" Drakon Drakon says "hi" You say "Well, it would be best to have a broad idea of the basics first." Drakon says "its IC of me" Hoverbot has left. You say "However, the best way to learn is hands-on." *Rusty* learning hands-on is FUN!!! ; Drakon says "if i change my name.. then i look like an object.. as long as i am not deted" Hollis says "I think I'll go to my room and play with it, this looks a little advanced for me" You say "Well, you might want the logs of the earlier 6 lectures." Drakon says "you aint seen nothin yet" You say "I started at the basics." Rusty says "how dod I do an IF THEN statement???" Hollis says "how do you get them?" Rusty says "how do you take a log???" You say "Well, you +mail me an email address." You say "I use TinyFugue's logging capability to produce an accurate log of my sessions here." Drakon says "lawson@inac.. doh!! lawson@in.. rrrrr.. lawson sorry.. i can't fix my typos.." Hollis says "I have a little gadget in Visual Basic for that. I use a text box on a form and then copy it to the clipboard" Message #3 -- n *Rusty* Rusty's is cooler *Drakon* OOC: if i get junk chia.. ain mail.. i e-mail bomb ya.. :) Drakon says "thats what i do" *Rusty* Rusty says "set your ooc messages to say your name..." *Drakon* OOC: why?... Drakon says "" *Drakon* OOC: oh i see now *Rusty* Rusty says "Because I dont even know who's doing that..." You say "Right. Anyway, back to coding." You say "IF ... THEN ... ELSE ..." Rusty says "yes???" Rusty says "how do you use those commands?" *Drakon* OOC: Drakon's controler types " hi " You say "Okay. There are basically two forms of this - one is for switching between @command, and one for switching between functions." *Rusty* Rusty says "good enough..." Rusty says "@command???" Drakon says "just type help @command" Rusty says "huh" You say "To switch between functions you can use if(), or ifelse(), or even switch() of you need a more complex form of choice." Rusty says "dont work" Mark_Farrell hums. "Lets all be quiet until I finish." Drakon says "help commands" Hollis leaves the Auditorium. Hollis has left. *Drakon* OOC: Drakon's controler types " ok " Hoverbot has arrived. Drakon dropped Hoverbot. bucket has arrived. Rusty dropped bucket. You say "Right. For something like choosing different messages to show somebody, you would use something like:" Hoverbot begins recording Rusty wishes he could record... You say "@va me=$password *:@pe %#=[ifelse(match(unlock,v(0)),You got it right,Access denied)]" Drakon says "fairly straight forward" *Drakon* OOC: Drakon's controler types " oops.. sorry " Rusty says "in English..." Drakon :) You say "Right - type 'help ifelse function' for the help on the syntax of ifelse." Drakon says "ssshhhhh.. don't be rude" Rusty says "if you please" West has arrived. West enters from the Quad. Rusty :) You say "Basically: if(,,)" Hoverbot says "" West leaves the Auditorium. West has left. Hoverbot slaps rusty bucket knocks Hoverbot silly bucket is now known as Bucket. You say "So, taking the coding example: ifelse(match(unlock,v(0)),....,....)" Rusty is lost You say "This looks to see if V(0) is equal to 'unlock'" Drakon nods Bucket has left. Drakon morphs into someone who always appears to understand You say "match(list of items,thing-to-match)" You say "So, match(A B C D E,D) is 4 - becase D is the 4th item in the list." Bucket has arrived. Rusty dropped Bucket. You say "So, match(A B C D E,S) is 0 - because S is not in the list." Rusty thinks he understands You say "So, if we have v(0) equal to 'unlock' :" You say "match(unlock,unlock) = 1" *Rusty* but still can't use it You say "ifelse() considers any number that isn't 0, or any string that is neither empty, or equal to #-1 as true." Drakon MORPHS into liquid form Drakon morphs into techie form You say "So, in effect, we have ifelse(TRUE, . . . , . . .)" Rusty morphs into a gigantic brain. Drakon nods Rusty ?????????????????????? Rusty is really lost Drakon says "then do.. this... , else.. do that" Rusty can't find his compass Mark_Farrell nods. "Okay. Lets start with a basic command to say something. *Drakon* OOC: Drakon's controler types " i have don't a .. done a little programming before.. so this is not all cantoneese " Rusty found his compass with Drakons help Vs: Rusty morphs into bored. Rusty says "Hello" You say "Examine wip/vs" Drakon says "this is very ooc of you rusty.. were you alwasy a changeling? or is this a recent event." Drakon says "ok" Rusty says "I am posing, not talking" Rusty says "Remember, I have always been a changling" Drakon thinks rusty used to be a human at one time Vs:$pwd *:@pe %#=[ifelse(match(unlock open,v(0)),{Unlocked},{Sorry - no access})] *Drakon* OOC: Drakon's controler types " ok " Bucket's Memorial has arrived. Drakon dropped Bucket's Memorial. *Rusty* Rusty says "First thing I did when I signed up with the Fed" *Mark_Farrell* Mark_Farrell doesn't care, but is here to help you code. If you don't want to focus on it, then I have better things to do. *Rusty* Rusty says "only thing that has changed is rank" Drakon whispers "i think i have this... the listen and basic command thing" *Rusty* Rusty says "Sorry kinda got carried away" Drakon says "i think i understand that little bit" Drakon says "anything else i can clear up using help" Saving TrekMUSE DataBase. Response will be slow for a few minutes. Drakon lags You say "Okay. Did you look at WIP/vs yet, Rusty?" Drakon says "i did" Rusty is Thankful for the help but is still a little Rusty(no pun intended) You say "Okay. 'examine wip/vs'" Drakon shakes his head Rusty says "WIP/vs?????????????????//" Mark_Farrell will go through it step by step. Drakon says "did that" Rusty says "done" Mark_Farrell points to the 'Work In Progress (WiP) that I put examples on. Drakon says "so thats what... oh.. sorry" Drakon ahems You say "Okay - firstly - we have a $ command." You say "$pwd *:" Drakon nods Rusty nods You say "This looks for anything that matches 'pwd '" You say "But not spoken or emitted text - just typed commands." Drakon says "k" Rusty nods You say "The is put into the first stack variable, v(0)." You say "That is because it is the first wildcard." Drakon says "0 is the key number here" Rusty understands it up to the ifelse You say "There are two types of wildcard - * which matches a sequence of words/characters, and ? which matches a single character." Drakon says "just" Mark_Farrell thinks of other people who will read the log. *Drakon* OOC: Drakon's controler types " just as in dos " Rusty ohhs Drakon understands.. no prob Rusty says "Oh, OK" You say "More than one wildcard would put the second into v(1), ther third into v(2) etc." Vs:$pwd *:@pe %#=[ifelse(match(unlock open,v(0)),{Unlocked},{Sorry - no access})] Rusty says "is there a limit???" Drakon has that part down pat too Drakon says "9?" You say "There are 10 stack variables." Rusty dittos Drakon You say "v(0) through v(9)" Rusty is clear now You say "Okay, then we have the command to do when the $ command is triggered by someone typing a matching command." Drakon used to think WiP was a weapon.. Drakon :) You say "The : indicates the end of the pattern to match, and therefore we have @pe %#=[ifelse(match(unlock open,v(0)),{Unlocked},{Sorry - noaccess})] as the command." Rusty thinks of the Feringi Whip and shudders Rusty spelt it rite Rusty ;) Drakon nods You say "@pe is a short form of @pemit, and %# is the database number of the person/thing what triggered the command." Rusty says "@pe???" Rusty says "nevermind" You say "@pemit displays a string to the given object, and only the given object." *Mark_Farrell* TIME:Fri Nov 17 18:52:11 1995. STARDATE: 95877.7 You say "'help @pemit' for a fuller summary." Drakon says "k then" Rusty understands You say "Then we have the functions that decide what we are going to print to the object doing the command." Bucket's Memorial has left. You say "The trick with looking at code to see how it works is to work from the inside (deepest nested) function outwards." Hoverbot Checks the time Drakon says "i think i understand this line now" You say "In this case: v(0). As I said earlier this the contents of the wildcard match. So, if I typed 'pwd Hello' v(0) would be hello." Rusty understands You say "Now we have: [ifelse(match(unlock open,Hello),{Unlocked},{Sorry - noaccess})]" You say "Then we look at the match(unlock open,Hello)" Rusty lags You say "Obviously, 'hello' isn't 'unlock' or 'open', so the match returns a zero." Hoverbot pokes Drakon. Drakon says "" Drakon noda.. nods Bucket has left. You say "Had we typed 'pwd unlock' the match would have returned 1, because match(unlock open,unlock) matches the first word of the list." You say "Likewize, 'pwd open' would return 2." Hoverbot whispers something to drakon. You say "For now, lets go back to 'pwd hello" Drakon says "ok.. i understand" You say "Now we have: [ifelse(0,{Unlocked},{Sorry - noaccess})]" You say "Finally: ifelse(0,{Unlocked},{Sorry - noaccess}) will return 'Sorry - noaccess' because 0 is false." Drakon says "so if i were to type unlock or open.. it wouldn't work?" You say "That gives us @pe =Sorry - noaccess." Drakon ah's You say "Exactly the reverse, Drakon." Hoverbot tugs on Drakon's arm again. *Rusty* it didn't work for Rusty Drakon says "oh.. ok.. so if it returned something other than 0 then it would say sorry.. bla bla" You say "If we type 'pwd unlock' or 'pwd open' then we have: ifelse(1 or 2,{Unlocked},{Sorry - noaccess}) - and that returns Unlocked becaue 1 and 2 are true." Drakon Flag set. WiP grows ears and can now hear. Flag set. You say "Try 'pwd open' rusty." *Rusty* 95877.7 19:00:50 *Rusty* Fri Nov 17 19:00:50 1995 Drakon says "sir... bot has informed me quite impatiently that it is type.. time for my ooc dog walking." Drakon says "i must go" Rusty waves Mark_Farrell nods. "G'evening, Drakon." Drakon says "thank you for clarifying that" Rusty says "are u coming back???" Drakon says "i will.. but not for a little bit" Rusty says "I typed it, but nuthin happened" You say "Okay." Rusty says "page me when u come back" Drakon waves Drakon has left. Rusty waves Hoverbot waves Hoverbot says "bye all" You say "Try it now, Rusty." WiP>> @pe #8731=>Unlocked WiP>> @pe #8731=Unlocked Rusty says "worked" WiP>> @pe #8731=Unlocked You say "And if you try something like 'pwd foobar' it will tell you no access" WiP>> @pe #8731=Sorry - no access Rusty says "great, I think I understand now..." You say "Okay. That is a basic way to switch between two different output strings." You say "If we wanted to switch between entirely different commands, or sets of commands, we could use @switch." You say "If you notice, in the case I just showed you, we always use @pemit." You say "Only the output changes." You say "We can do this using an @switch." You say "Examine wip/vs" You say "Examine wip/vt" Vt:spwd *:@switch [match(unlock open,v(0))]=0,{@pe %#=Sorry - no access},{@pe %#=Unlocked.} Vs:$pwd *:@pe %#=[ifelse(match(unlock open,v(0)),{Unlocked},{Sorry - no access})] Rusty has really got to go... You say "Now, both of these commands do exactly the same thing." Rusty doesn't want to be rude You say "No problem." Rusty says "sorry" Rusty says "when do you have these workshops???" You say "Just to say that in this case vs is the better way of doing things." You say "Every Friday, 6pm, in here." *Rusty* Rusty says "I have a pad right here" You say "It's in my 'det'" Rusty says "det???" You say "Type 'det Farrell' - short for 'detail Farrell' or 'detail Mark_Farrell'" Rusty waves *Mark_Farrell* TIME:Fri Nov 17 19:10:42 1995. STARDATE: 95877.7 Rusty leaves the Auditorium. Rusty has left. You say "Take care."