WIZARDRY COMPILED by Rick Cook

Four : Fenceposts and Falling Rocks

Those who can’t do, teach.

—article of faith among students

And vice-versa.

—programmers’ addendum to students’ article of faith

Malus was waiting impatiently when Wiz arrived, obviously fuming.

To salve wizardly pride, Wiz did most of his teaching of actual wizards in private sessions. Malus was one of his least-favorite pupils. As a person, the pudgy little wizard was nice enough, always merry and joking. But he had particular trouble in grasping concepts and the thought that he was a slow learner made him even more resistant to the new magic.

Malus didn’t even let Wiz finish his apology for being late.

“This spell you showed me,” he said accusingly. “It does not work.”

Wiz sighed inwardly. “Well, let me see your code.”

Grudgingly, the plump little sorcerer produced several strips of wood from the sleeve of his robe. Laid in the proper order the characters on them would list out the spell. Putting them on separate pieces of wood was a safety precaution against activating the spell by writing it down.

Wiz arranged the wood strips on the table and frowned briefly at what was written there.

“Oh, you’ve got a fence post error.”

“Fence post?” the wizard asked.

“Yeah. Look, say you’ve got a hundred feet of fence to put up and you need to put a post every ten feet. How many posts do you need?”

“I am a wizard, not a farmer!” Malus said, drawing himself up to his entire five-foot-four.

“Well, just suppose,” Wiz said half-desperately.

Malus thought hard for a minute. “Ten, of course.”

“Nope,” Wiz said triumphantly. “Eleven. Unless you strung your fence in a circle.”

“But one hundred taken as tens is ten.”

“Yeah, but if you’ve got a hundred feet of fence and only ten posts in a straight line, you leave one end of the fence hanging free. If you put the posts in a closed figure, you only need nine because you start and end on the same post.”

“And how am I to know such things? I told you I am not a farmer.”

“Well, just keep it in mind, okay? Boundary conditions are always likely to give you trouble.”

“Borders are always unchancy places,” Malus agreed.

“Uh, yeah. Let’s leave that for a minute. Do you have any other problems?”

“There is this business of names.”

For about the fiftieth time, Wiz wished he hadn’t been so cavalier in choosing names for the standard routines in his library. To wizards, a thing’s name was vitally important and they took the name to be the thing.

“I told you that the names I used aren’t necessarily representative.”

Malus looked at him like he was crazy. “Very well. But even granting that, why must the names change haphazardly? That is what I do not understand.”

“They don’t change at random. They don’t really change at all. It’s just that an object can be a member of more than one class.”

“Classes again!”

“Look at this,” Wiz said, dragging out a couple of sheets of parchment and laying them out side by side so all the spell was visible. “Okay, here this variable is called ‘elfshot,’ right?”

“Why is it named that?”

“It’s not named that. That’s only what it’s called in this routine. Its name is ‘dragons_tail’.”

“Well,” demanded the wizard, “if it is ‘dragons_tail’, why do you call it ‘elfshot’? And how do you add a ‘dragons_tail’ to this, this loop variable.”

“No, no,” Wiz said desperately. “It is actually seven at this point in the program and that’s what gets added to the loop variable.”

“Well, if it’s seven then why don’t you just say so?” roared the wizard.

“Because it isn’t always seven.”

The wizard growled in disgust.

“Look, I think I’m getting a headache. Why don’t we leave this for right now, okay? Just try working the program through again and we’ll go over it in our next session.”

The early end to the tutorial with Malus left Wiz with time to spare and a completely ruined temper. He wanted someplace quiet where he could be alone to think. Leaving his workroom door unlocked he left the central keep, threaded his way through two courtyards and climbed a set of stairs to the top of the wall surrounding the entire complex.

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121

Leave a Reply 0

Your email address will not be published. Required fields are marked *