webnovel

Wizardry and Programming.

Krynt was very mature for his age. He liked reading books, observing and evaluating people he met. It came as a surprise when,at his eleventh birthday, he learnt that he was a wizard. But, it also gave him a direction, a clue to the origin of the ability he possessed. Join Krynt in the adventure that awaits him at Hogwarts, or maybe something more grand...

Mike_Lu · Book&Literature
Not enough ratings
4 Chs

Modify the first spell.

As days went by, I slowly adapted to my life at Hogwarts.

I found that many of the assumptions that I previously had about magic were wrong.

Magic was not what I had imagined it to be. I thought there would be fewer rules to magic for the fact that it was 'magic', but how wrong I was!

Casting a spell, even the simplest ones, required precise wand movements, perfect pronunciation, and the right purpose. We could cast a spell with 'less precise' wand movement, but that would have unintended consequences.

Overall, it was difficult to cast spells. It wasn't easy to make a potion, either. The books' instructions were inadequate, and if you made a minor error, it went boom. Furthuremore, Professor Snape's instructions came across as more of a threat than anything else.

However, I was fortunate. My skill turned out to be useful in the realm of magic as well. I could adjust the way a spell was cast, the impact it had, and even the incantation if I wanted to.

The levitation spell that we were taught in our charm class by Professor Flitwick, was the first spell I chose to modify.

It was not difficult to put my ability to use. All I had to do was touch a blank sheet of paper about the size of a book and think about my ability. After then, a screen-like interface with five squares would emerge on the paper. The first on the left already had the word "class Wizard(Human)" written in it, while the others were blank.

I couldn't figure out anything when I initially found my weird skill. But, by coincidence, at the age of ten, I came upon a book about computer programming in the public library, which I occasionally visited, and learned about 'object-oriented programming' from there.

Classes and objects, all made sense to me. I figured out how to use my ability, at least to a certain extent.

Coming back to spells, I first made a 'class' named 'Spell' by tapping on the second empty square from the left and typing it on the virtual keyboard that emerged as a horizontal panel at the bottom of the page. When I pressed the save button, a new screen appeared. The top left corner of the page had 'class Spell:' written on it. The cursor was four spaces to the left underneath it. The attributes that any instance of this class would have, such as invocation, wand movement, casting time, and so forth, were then initialised.

After that, I defined some methods (function inside a class) to manipulate any instance of that class, like, if I wanted to make it silent I could call a method that makes the incantation attribute 'false'. After saving the class, a new page appeared that had a blinking cursor at the top left. I typed 'Leviosa = Spell('Wingardium Leviosa', Swish and flick, 0.001).

What it meant was that I created an instance of the class Spell that had 'Wingardium Leviosa' as an incantation, Swish and flick was the wand movement and the casting time was 0.001 second and set it to 'Leviosa'.

What I needed to do now was define the term "swish and flick." It was simple; all I had to do was tap it and make a wand motion. Then I used a 'if statement' with the condition that the code will run if I do the wand gesture that I saved in the 'Swish and flick' variable. I didn't need the page anymore after storing it. I could now activate the levitation spell by saying 'Wingardium Leviosa' with that exact wand gesture. And it worked the first time I tried it. However, the outcome was no different than what I could have achieved if I had simply learned it like any other student and not used my abilities.

So, for the next week, I spent most of my time experimenting with my abilities to perfect the levitation spell. After numerous trials and errors what I came up with was something very different from a spell. It was like a whole new power. I could manipulate an object just by mere thought. Yes, I tweaked the levitation spell to the point that it resembled a telekinetic ability. The only downside to it was how fast it depleted my energy. After only a few minutes of use, I was exhausted.

...

I was too busy with experiments and school work to notice the passage of time. On October 31, the cheerful atmosphere made me realise that two months had already passed by.

I gave up my experimentation for the day and just indulged in the excitement like everyone else.

But something happened on that night that halted all the celebrations. While we were enjoying the feast at the Great Hall, Professor Quirrell came running into the hall, shouting "Troll in the dungeons! Troll in the dungeons!".

And then the chaos ensued. Students were screaming and running like headless chickens when a loud 'Silence!' stopped them. They all looked at the high platform, at the source of the sound. It was none other than Dumbledore.

"Prefects, lead your house to the dormitories," he said calmly. "And teachers, follow me to the dungeons."

I was really curious how a troll looked like in real life so I slipped through the crowd while it was still a bit chaotic.

For most people, Hogwarts Castle was a maze, but for me, who had some memory control, remembering the broad routes was not tough. That was accomplished by modifying my memory properties in the 'Wizard(Human)' class.

As I was heading towards the dungeon, I heard a loud crashing noise. I thought it might be the troll.

I was a little frightened. I realised that wandering about a castle with an actual troll running loose was a bad idea. But I couldn't help but be enthralled by the prospect of seeing a real troll. So, without wasting any more time, I dashed in the direction of the sound.

When I thought I was close to it, I saw the professors running into the bathroom, from where the sound was coming from.

'I've already come this far; I might as well see it if it's here,' I reasoned. I then strolled silently to the bathroom. Professor McGonagall's outraged voice reprimanding Harry, Ron, and Hermione could be heard just outside the toilet door.

I turned around and was about to flee before the Professor could notice me, but before I could, I heard a sharp voice, "And where are you going, Mr Helder?"

I slowly turned around to face Professor McGonagall. She was really mad.

"I was a bit curious," I said with a little hesitation while trying to look past them and see the troll. It was as big as the book said.

Professor McGonagall got even angrier and was about to explode, but was stopped by the headmaster.

"No need to be so angry, Professor McGonagall. It's just innocent curiosity," He said. "And, Mr Helder, I hope you will be less reckless from now on."

"I will, Headmaster," I said, just like how a soldier would say to his commanding officer, and then headed back to my dormitory.

...

I had a dream that night. In the dream, I was exploring the castle as an innocent little child when I came across a Troll and died under its massive club. It was both absurd and terrifying. But, to be honest, I had my doubts about Hogwarts' safety standards. So, aside from finishing homework and assignments, my only focus for the next few months was on modifying self-defense spells.

I had a rough concept of what spell I wanted to change. It was the shield charm 'Protego,' which creates a barrier that shields the user from common spells and physical items. But it wasn't enough; I needed a shield that could block anything, whether it was a powerful spell or a large object.

Conjuring a physical object in the spell's path was a good alternative, but it was still perilous because the spell could shatter the thing into many pieces, which could be harmful. 'What if I had a "Protego" shield underneath a physical shield?' I reasoned as a solution. That concept appealed to me as a possibility. I was surprised to discover that I could combine the properties of one spell with those of another after experimenting with conjuring and shield charm.

...

On my quest to modifying and perfecting my new spells, I spent most of my time either doing homework, reading at the library, or doing the actual coding. Except for the fact that Harry Potter was dangerously close to dying or suffering significant injuries in his first Quidditch match, nothing major happened at school to distract me from my goal.

I didn't experience any joy or sorrow this Christmas. I was as unconcerned as I had been on any other day. I didn't return to the orphanage, opting instead to spend my time at Hogwarts doing what I enjoyed the most, "spell coding." The name may sound cheesy, but it accurately described what I did the most of the time: changing spells using codes, much like a computer programmer does when creating software.

In Python language, Class is like a blueprint and the objects are the variables that are set to an instance of the class.

Mike_Lucreators' thoughts