《Programming Wizards!》Gyroplane
Advertisement
“A friend of mine returned from an expedition yesterday.” The students attentively listened, for stories from beyond Rorohiko were rare. “They flew over a forest in a gyroplane.” He looked around. “Does anyone know what a gyroplane is?” He pointed to a student with his hand raised.
“A vehicle capable of flying in any direction or hovering in place using its propellers.”
“Yes, what is your name?”
“Roy.”
“Roy, do you know how we can keep its propellers turning?”
He thought for a moment, then shrugged. “I’m not sure what you mean.”
“How can we run code repeatedly?”
He thought some more. “Wouldn’t you have to keep executing the code again and again?”
“Yes, do you know how to write that in code?”
“No, unless you’re about to teach us how to do it at runtime.”
Vick smiled, he knew this class was different. “Yes. Today, you will learn how.”
while (true) { Console.WriteLine(“Looped!”); }
“Above me,” he pointed to the screen, “is a ‘while loop.’” He executed the code. ‘Looped!’ it said. Then, on the line under it: ‘Looped!’ Then, on the line under that: ‘Looped!’ Then, over and over and over. “It will continue to execute as long as its condition is true. What we’ve created is an infinite loop.”
int i = 0; while (i < 5) { i = i + 1; Console.WriteLine(“Loop #” + i); }
He ran the code, and after displaying five lines, ‘Loop #1,’ ‘Loop #2…’ the program completed its execution. “The condition is checked before the execution of the loop. The loop is only executed if the condition is true. What we’ve made is essentially a ‘for loop.’”
Advertisement
for (int i = 0; i < 5; i = i + 1) { Console.WriteLine(“Loop #” + (i + 1)); }
He ran the code again, and it displayed the same five lines. “Instead of declaring an integer beforehand, and incrementing it in the loop, we can declare it, condition it, and increment it in a single line. That’s the power of a for loop. Note how we add one to the variable ‘i’ before concatenating it. This is because, in a for loop, the increment occurs after the loop’s execution. Whereas, before we incremented ‘i’ at the start of the loop.”
do { Console.WriteLine(“Looped!”); } while (true);
“The last loop is similar to a while loop,” he raised a finger, “with one important distinction. It executes at least once. Meaning, it executes once, then evaluates the condition to figure out if it should execute again. This is a ‘do while loop.’ Or simply, ‘do loop.’” He looked over the class, looking each student in the eye. “If you are to become apprentices, you must be wary with your use of loops.” His voice was uncomfortably firm, almost grim. “We will entrust you with precious resources, if you accidentally make an infinite loop where resources are expunged, there will be grave consequences.” He diverted his attention back to the computer. “Now, what does this have to do with gyroplanes? Well, their propellers need constant energy to spin.”
bool isOn = true; while (isOn) { Console.WriteLine(“Spin!”); }
‘Spin!’ said the screen over and over. “Yes, it is an infinite loop. However, another process would be occurring between each loop. That process would detect if a button was pressed which toggles the boolean. When that button is pressed, the loop will evaluate its condition as false, stopping it.”
Advertisement
for (float speed = 1f; speed < 20f; speed += 2f) { Console.WriteLine(“Spinning at speed: ” + speed); }
“The ‘f’ letter at the end of the numbers is to indicate it as a float in this language, not to be confused for an integer. The speed of the propeller can be controlled with each execution of the loop. Begins at one, only executes if it’s below twenty, increments by two every loop.” He walked closer to the class and stood taller. “Because of our great wizards, we were able to construct hardware that made it impossible for a propeller to spin too fast. So, even if we made an error where the speed became an enormous number, the propeller would simply rotate at its max speed dictated by its hardware. Just as integers and floats have a min and max range, so does the speed of a propeller. Zero being its min, and around four-hundred being its max.”
“What does ‘speed += 2f’ mean?” asked Willard.
“That’s shorthand for incrementing by two, and then setting that value to the variable.”
After class, the three huddled to converse. “Hey,” said Willard. “Does anyone know what a forest is? I heard Mister Vick use that word.”
“I’m not sure,” said Andrew, and Gus shrugged.
“It’s a massive cluster of trees,” said Roy, from down the hall, and walked towards them.
“Like, five or so?” asked Willard.
“No,” said Roy and stretched his arms to his sides. “A thousand kilometers, maybe more.”
Everyones’ jaw dropped. “What?” said Gus.
“A thousand kilometers? That’s impressive,” said Andrew.
Advertisement
-
Glitch
202X - The Universe is proven to be a Simulation An outbreak of nihilism and crime follows the discovery. It is not long before institutions and criminals develop a way to cheat our false reality and achieve impossible feats. They call this new tool Glitch and its uses vary: from editing the body with superhuman capacities to manipulating the elements and the Earth. Those who yield this new power are called Glitchers, and they are held as the Greek Heroes of the new times. Edward Williams is a naïve anime-geek teenager from Chicago who dreams of making a difference in the world. He becomes a Glitcher when Thief Queen Elizabeth Shao, a legendary Glitcher herself, suffers a betrayal by the hands of her comrades and invades the boy’s body in order to cheat Death and plot her revenge. Together, Edward and Thief Queen will build new bonds, live many misadventures and try not kill each other in an ever more chaotic America. Cover art by the talented graphic designer ssddx. The entire novel's philosophical proposal is about finding meaning in a nihilistic world. This novel is a fun juvenalia take on the impact of the 'Death of God' and Descartes's skepticism. ;) (Back cover)
8 174 -
Tale of Lolicon in Another World
Preface : Fanfiction yet Original. Fanfiction because there'll be a lot of character and town name that taken from popular game/manga/novel. Only the character name is same. Character personality is following mine (Author) dream. Original story created by me. Based of my unique dream 10 years ago. ----------------------------------------------------------------------------------------------------------------------------------------------------------- Synopsis : 5 years after the dissapeared of his father, Ryousuke Akira got a mysterious package from him. He then knew the existance of the another world Edea. With the help the item power he then train himself untill limit. 10 years after that he meet the self proclaimed goddess in the hospital room after 2 months hospitalized because of traffic accident. Using the ability he got toward the goddess he then obtained a 'cheat'. Using his cheat he 'collect' his dream as a gentleman (Lolicon). Starting the journey with destroying a Kingdom that hunt him, he leisurely go tourism while adding more harem member to go to the promised place Midgard
8 161 -
Celestial Spark
Mages traditionally make poor fodder, but with proper training and motivation, possess near limitless potential. For mage teams, the battle camps of the Upper Realms provide both, with missions ranging from orc hunts to political espionage. This tale follows one such team of four who strive to prove themselves in a world that would rather overlook them. Loyalty, honour, and devotion are contrasted by avarice, treachery, and apathy, though at times it can be difficult to separate vice from virtue. For though all people, whether they hail from the peripheries or the kingdom capital, are subjects whose fates are bound to the stars, their choices must be their own. Any comments or questions are welcomed.
8 67 -
Underground
Ava, an innocent small-town girl, gets sucked into the world of underground fighting when she catches the eye of Shawn Michaels, the irresistibly hot reigning champion. *****Ava McAdams isn't sure what to expect when she moves to Boston for college. Her sheltered upbringing leaves her exposed to a harsher world, and one complicated male in particular -- Shawn Michaels, the tattooed and intimidating underground fighter who is nothing like anyone she has ever met before. But is falling for him worth the risk of knowing she might lose him every time he enters the ring?[word count: 100,000 - 150,000 words]Cover designed by Ren T
8 81 -
I AM ABSOLUTE
They tell me I'm a god, I'm lost in the facadeSix-feet off the ground at all times, I think I'm feelin' oddNo matter what I make, they never see mistakesMakin' so much bread, I don't care that they're just being fakeThey tell me they're below me, I act like I'm aboveWARNING:LIKE I SAID THIS IS A GODLIKE AU,AND I MEAN GODLIKE ,HE WILL HAVE NO EQUAL IN TERMS OF POWER AND SKILL .HE WILL HAVE GOOD FIGHTS BUT he will not lose. This is be rated M it will also contain lemons ,buy will get to know them before. violence, language and sexual themselves
8 97 -
Writers Digest {A Writing Guide}
A guide from Creating Covers to Creating the perfect character. This guide has it all!
8 152