mcdaniel@uiucdcsb.UUCP (01/22/85)
Problem: When using the 'c' command, the user is asked Do you want to name an individual object? [yn] However, the game does not verify that the reply is one of 'y' or 'n'. In particular, if the reply is not 'y', it is assumed to be 'n'. Fix: Add an extra test in hack.do_name.c. If reply is 'y', call one object; if 'n', call a class of objects; otherwise, exit the 'c' command. Context diffs: --------------------------------------------------------------------- *** old:hack.do_name.c Mon Jan 21 01:43:28 1985 --- hack.do_name.c Mon Jan 21 01:50:11 1985 *************** *** 134,139 ddocall() { register struct obj *obj; pline("Do you want to name an individual object? [yn] "); if(readchar() == 'y'){ --- 134,141 ----- ddocall() { register struct obj *obj; + /* bug fix: temp var needed */ + char reply; pline("Do you want to name an individual object? [yn] "); /* bug fix: read into var, and accept only y or n */ *************** *** 136,142 register struct obj *obj; pline("Do you want to name an individual object? [yn] "); ! if(readchar() == 'y'){ obj = getobj("#", "name"); if(obj) do_oname(obj); } else { --- 138,146 ----- char reply; pline("Do you want to name an individual object? [yn] "); ! /* bug fix: read into var, and accept only y or n */ ! reply = readchar(); ! if(reply == 'y'){ obj = getobj("#", "name"); if(obj) do_oname(obj); } else if (reply == 'n') { *************** *** 139,145 if(readchar() == 'y'){ obj = getobj("#", "name"); if(obj) do_oname(obj); ! } else { obj = getobj("?!=/", "call"); if(obj) docall(obj); } --- 143,149 ----- if(reply == 'y'){ obj = getobj("#", "name"); if(obj) do_oname(obj); ! } else if (reply == 'n') { obj = getobj("?!=/", "call"); if(obj) docall(obj); } -------------------------------------------------------------------- If I am confused, ignorant, or wrong, please enlighten me. UNIX is a trademark of ATT. VAX and PDP are trademarks of Digital Equipment Corp. The opinions expressed above are my own, and are not in any way indicative of the opinions of any other entity or group of entities in this universe. Void where taxed or prohibited by law. This space for rent. She bop, she bop. Tim McDaniel Usenet: ...{pur-ee|ihnp4|convex}!uiucdcs!mcdaniel Csnet: mcdaniel%uiuc@csnet-relay.arpa (really!)
rob@ark.UUCP (Rob van Leeuwen) (01/26/85)
I think this "bug" is a feature. Let's say you want to CALL (not NAME) a certain wand, a wand labelled 'v'. What you type is this: cvv This means: c : call v : answer to [yn] question, -> 'n' v : object to call Since the action of calling something is much more performed than naming something, it is only logical that you have to type an explicit 'y' when you want HACK to do something that doesn't occur that much. -- Rob van Leeuwen ..!mcvax!vu44!botter!ark!rob
kel@ea.UUCP (02/08/85)
[Ulch! That meat was tainted!] If the prompt says '[yn]', any other stroke should be considered a miskey and be ignored. This allows the user to proceed with greater confidence and rapidity than if you ask for yes or no but anything will do for no. Gak! Such sloppiness should be reserved for machines that don't have enough address space to do better. Ken