Prev
Ch. 59 / 28421%
Next

Chapter 59: Transformation Spell

~6 min read 1,104 words

Allen stared grimly at the mirror’s glowing screen, convinced that the empty values of these two key-value pairs were due to his oversight during the incantation.

He carefully recalled every detail of his spellcasting in the abandoned girls’ bathroom.

Soon he remembered: just now, he had wished to see the screen from his first transformation of the Lei Niao’s eye, when he had turned a matchstick into a needle.

Thus, only the first key-value pair had a value—and that value described the transformation result...

A sudden insight struck Allen, and he immediately adjusted what he wished to see.

This time, he wished to see the screen from November, when he had mastered the new application of the Transformation Spell—the handkerchief folding itself twice in succession.

As he adjusted his inner focus, the screen in the mirror changed.

This time, the first key-value pair’s value was empty, the second’s was no longer empty, and the third’s remained empty.

Allen eagerly examined the second key-value pair’s value; it was composed of ancient magical runes, and he could vaguely recognize the meanings of a few familiar ones, but could not discern their purpose.

He also noticed the format of this value was unfamiliar—he strained to relate it to any data structure he had known before, but found no connection.

He recalled Professor McGonagall’s words about this application: “Assigning behavioral logic to the transformed object.”

Allen fell into deep thought: behavioral logic was meant to be executed by the transformed object...

Executed?!!

Allen suddenly understood: if the Transformation Spell were a computer function, these three key-value pairs would be its three parameters—parameters typically being basic data types, like the dictionary mentioned earlier; but in most advanced programming languages, a parameter could pass a closure—a function defined within another function.

In simple terms, it meant passing a segment of code into the function so the function could execute it.

Applied to the Transformation Spell, the caster’s mental image of the object’s intended behavior would be translated into something like code: first fold from the left edge, how long should each fold be, only after the first fold is complete can the second begin, and how exactly should the second fold proceed...

This code-like segment was the value of the second key-value pair—this parameter determined how the transformed object should act; the more detailed the code, the more precise the object’s movement.

This code-like information would also be sent to the World Will, and when the World Will manifested the spell’s effect, it would embed the behavioral logic within this code into the transformed object.

This discovery instantly sparked Allen’s interest—he never imagined magic in this world could be analyzed through programming concepts to this extent. Then what exactly was this “World Will” he had named? It was a question he had pondered endlessly, yet never solved.

But the question was too vast—he quickly pushed it out of his mind.

He turned his gaze back to the second key-value pair’s value: since it was written in ancient magical runes, did that mean ancient runes were also a programming language, usable for coding?

As a former programmer in his past life, Allen found this idea fascinating—he never expected his old profession would still be useful in this magical world, and he was almost eager to start coding with ancient runes.

But he knew the conditions weren’t ready yet—he still knew too few ancient runes, and to code with them he needed to understand their syntax, and most importantly, he had no idea where to find a compiler for ancient rune programming.

Allen sighed deeply and turned his attention to the third key-value pair of the Transformation Spell—its value was also empty.

This time, Allen was far more experienced.

He instantly recalled Professor McGonagall’s new application of Transfiguration: establishing a link with the transformed object to control its movements in real time.

Clearly, the third key-value pair determined whether a link had been established with the transformed object.

Professor McGonagall began teaching these new applications in early November; by December, Allen had already mastered both. So when he transformed the Lei Niao’s eye in December, he had indeed cast the Transformation Spell with a link established.

He quickly recalled the memory of that spell: he had linked to the handkerchief and also assigned it behavioral logic—the link allowed him to control the handkerchief in real time, correcting its movements to make the folds more precise.

Then he used the same method to make the screen appear again in the Mirror of Erised.

Indeed, this time the first key-value pair was empty, and both the second and third had values.

The third key-value pair’s value was especially short, and the ancient rune Allen recognized—it meant “YES.”

So Allen deduced that the key of the third key-value pair meant “whether to establish a link.”

He wanted to jot down the key immediately, but realized he had no paper or pen—he could only stare harder, trying to imprint it into his memory.

But the more he stared, the more familiar the ancient rune seemed—until finally he remembered.

The key in the “Serpensortia” spell’s key-value pair bore a similar rune, and the caster could also establish a link with the snake summoned by that spell—so the linking mechanism was identical in both spells.

As Allen stared intently into the mirror, Harry and Ron broke free from his Petrificus Totalus—Allen remained unaware.

Harry and Ron exchanged a silent glance at Allen’s entranced state, then lunged at him together.

“Allen, you’re despicable—casting spells on your best friends! Ron, let’s teach him a lesson!” Harry’s suggestion met with Ron’s enthusiastic agreement.

Allen instantly reached for his wand, but Ron seized his arm; facing their assault, Allen wisely surrendered, collapsing to the floor.

“Alright, alright! I’m sorry! I won’t look at the mirror anymore—I’ll let you two have it!” Allen pleaded softly.

“Don’t change the subject—let’s talk about your sneak attack!” Ron wasn’t fooled; lying on the floor had cleared his head, and he no longer cared much about what the mirror showed—he began tickling Allen instead.

Allen couldn’t hold out—he was terrified of tickling.

Suddenly, voices echoed down the corridor, ending their struggle—they hadn’t realized how loud they’d been.

“Quick!”

Ron had just thrown the Invisibility Cloak over all three when Mrs. Norris’s gleaming eyes turned into the doorway. The three stood motionless, all thinking the same thought—does the Invisibility Cloak work on cats? After what felt like a century, Mrs. Norris finally turned away.

“Still not safe—it probably went to find Filch. I’m sure it heard us. Let’s go.”

Ron pulled Harry and Allen out of the room.

End of Chapter

Prev
Ch. 59 / 28421%
Next
Prev
Ch. 59 / 28421%
Next