Sunny stared at the errors and groped for her backpack. Her fingers were trembling slightly, despite her efforts to keep them steady, but she managed to get the pack open. Sunny pulled out the reference manual and hefted it in her hands. Putting on a brave face, she said, "Alright. Which one of you wants to get conked out first?"
She surveyed the errors around her. They stood there, motionless except for the streams of red text that flowed around them. Sunny took a deep breath, then picked one at random and pulled the book backwards, readying for a good solid strike to the face. But suddenly, she saw a glimmer of gold from the helmet of red text that was covering the error she was targeting. Sunny narrowed her eyes. "So you have gold laser weapons? Is that it?"
Something about the glimmer made her pause, though. It didn't feel threatening, even as it grew larger. Sunny readied the reference manual as a shield, just in case.
But the light was not, in fact, some kind of deadly laser. On the contrary, it enlarged into a line of text– or rather, code. Sunny blinked at it.
System.out.println("Hello, world!")
Sunny's arms dropped, and she clutched the manual like a teddy bear instead as she examined the line. She wasn't quite sure what it was, but something struck her as being off. "Shouldn't there be a semicolon at the end there?"
With her finger, Sunny cautiously reached out to draw on a semicolon. And– to her surprise– her finger left glowing lines in the air in the form of a slightly-misshapen semicolon. Then the wobbly punctuation mark flashed and became as neat as if it were typed, just like the rest of the line of code.
System.out.println("Hello, world!");
As Sunny watched with wide eyes, the line of code grew brighter, then disappeared in a flash. And the error behind it dissolved into pieces of red text. A couple pieces of text snaked into the reference manual in Sunny's arms, but the majority seeped out into the rest of the kitchen, seemingly searching for a way out.
Sunny stepped backwards. There was no sign of the error that had been there before. "So…" she stopped, trying to work out what had just happened. "Was that the error of missing semicolons, or something? I think I read that small errors like that were called syntax errors." Sunny patted the reference manual absently. "Do I just need to fix all of you errors?" She surveyed the remaining errors with new eyes.
Behind her, Jasper muttered something, then typed furiously. Robert was unnervingly silent. Sunny bit her lip; she'd have to do this fast, then. Assuming she could replicate whatever "this" had been.
"Okay. Sunny against the syntax errors of doom. I got this." Sunny turned her attention to the next error and breathed a sigh of relief when she spotted the glimmer again. This time, it enlarged into a larger piece of code.
int x = 16;
if (x = 19) {
System.out.println("x is 19");
} else {
System.out.println("x is not 19");
}
"Semicolons are all there, and it looks like x is initialized correctly," Sunny murmured under her breath. "Then the if statement– wait. A single equal sign is used for setting the values of variables, right? I'm pretty sure comparison uses something different…" Sunny squeezed another equal sign into the parentheses.
int x = 16;
if (x == 19) {
System.out.println("x is 19");
} else {
System.out.println("x is not 19");
}
The text flashed golden and disappeared again, and the error it was connected to unraveled as well. Sunny had to stop herself from punching the air and crying out, "Yes!" She darted a quick glance back over the counter at Jasper. He seemed pretty absorbed in tampering with Robert's code, but a shout would probably alert him. So Sunny settled for a large grin and a mental pat on the back.
Sunny debugged the next few errors in the same way. A couple of them were obvious, but for others, she had to remember what she'd learned, or quickly flip through the manual. (Maybe, just maybe, Robert was right; her brain and information could be just as effective as a weapon.) But just when the other errors had started to shift nervously away from Sunny and free up some space around her, she encountered an error involving methods.
public static boolean isEven(num) {
System.out.println(num%2 == 0);
}
Sunny read through the code once. Then twice. Then she took a breath and tried to talk through it, word-by-word, trying not to let her confusion in the café shake her. "So, Robert said I didn't need to worry about ‘public' or ‘static.' So then there's ‘boolean.' That– that means the method returns a boolean, right? Okay, so does it?" Sunny glanced at the code again. "Looks like it just prints. So do I…?" Sunny changed the print statement to a return statement.
public static boolean isEven(num) {
return (num%2 == 0);
}
She waited for the words to flash and disappear, but nothing happened. Sunny let out a shaky breath. Had she done something wrong? Should she have changed "boolean" to "void" instead? But no, boolean should've been fine if a boolean was returned– which one was. num%2 == 0 looked like it could've been a condition for an if statement, so it was a boolean. Sunny combed through the code again. "‘isEven' seems like a good, clear name. Then ‘num'...?"
Sunny tried to think back to the examples that Robert had given her before. Then it hit her. "The type! It's missing the ‘int.'"
public static boolean isEven(int num) {
return (num%2 == 0);
}
This time, the code glowed and disappeared. Sunny breathed a sigh of relief. Including two errors had been tricky. What did that error even represent, then? Just any errors within methods? Quickly, Sunny dismissed the distracting question and attacked the two remaining errors with renewed vigor.
Finally, Sunny had cleared a path out of the kitchen area. She kept a good grip on the manual as she ran back out to the main area of the fast-food building, the thrill of solving the errors still buzzing in her.
"You there!" she declared imperiously, pointing a righteous finger at Jasper. Jasper jolted, then turned around and glared at her.
"I'm working on a solutio–"
Sunny used her non-pointing hand to heft the reference manual threateningly. "I will gladly chuck this book at your head if you don't unhand Robert immediately." A dangerous grin spread over her face.
Points: 20490
Reviews: 436
Donate