#...just to clarify I don't normally skim read
Explore tagged Tumblr posts
latias-eevee-hatori · 6 months ago
Text
When a completed fic mysteriously updates with a new chapter, but it is not the final chapter and there are no author's notes about it at the beginning nor end.
??????????????????????????????
3 notes · View notes
fanfics-for-you · 2 months ago
Text
what's in a name? || Patrick Verona (TTIHAY) x gn!reader (Modern!College!AU)
AVAILABLE ON AO3 (SOON)
Tumblr media
Inspiration: ✨️Patrick Verona✨️
Summary: Patrick Verona is apparently the most intimidating guy on campus. You just want to get by, pass your classes, and get to your actual dreams. When you casually approach him one day and decidedly are not scared of him, Patrick has some questions.
TWs: light language, use of Y/N (only like twice), second person POV (you, yours).
[[A/N: This is basically under the concept that you approach Patrick first, and aren't really as afraid of him as anybody else. He's intrigued. Also this is a college AU, because I am in college and I think it's weird to write about high school lmao. ALSO,,, I know this is incredibly niche and a dead tag, but... I watched the movie recently and was violently possessed to write this. The parasites in me what to continue this universe, but idk. Anyway. Enjoy :)]]
Tumblr media
You were exhausted. Totally and completely exhausted.
You'd stayed up all night for your chem quiz, and still, didn't think you did great on it. Which made your day ever so worse. So, when you went to the library, and someone was sitting in the spot you always sat in, you halfway wanted to cry and halfway wanted to rip your hair out. Normally, such a thing wouldn't be a big deal, but today it was. So, with a certainty that rivaled a lawyer in court, you stomped over to the chair.
For a moment, the guy didn't even look at you. He kept staring at his friend, a surprisingly 'metal' dressing guy who was talking avidly about something.
You cleared your throat.
That's when they both looked at you.
You were entirely focused on the one in your seat. A taller guy with built shoulders, curly hair and a sharp jaw. In normal circumstances, you'd probably think he was hot. Today was not normal circumstances.
The man raised an eyebrow.
Okay, so maybe it was a little normal circumstances, but that wasn't relevant.
"What are you doing?"
The man answered, simply -maybe a little confused, "Sitting?"
"That's my spot," you clarified, pointedly.
"Oh, I'm sorry-" the man pretended to start getting up before pausing -speaking sarcastically, "-Oh wait, I've just remembered, this is public property."
Mindlessly noting that he had an accent that you couldn't quite place, you rolled your eyes, "I sit there everyday. Just give me the spot."
"You weren't sitting here all day," he pointed out, "-or else I wouldn't be here."
You pressed your lips together into a thin line, "I was busy failing a chem test, now get up."
His eyes skimmed over your face, thoughtfully, "Do you know who I am?"
"Why-" you sighed out, frustrated, "-would I know who you are?"
Even despite the comment, he did seem familiar somehow but you weren't going to tell him that.
He furrowed his eyebrows for a moment, and didn't say anything. You felt like you were going to explode in fiery flames.
You groaned, "Oh my god. There are thousands of seats on campus, just go sit somewhere else."
"Exactly," the man countered, "-why don't you sit somewhere else?"
"Because-" you huffed out a breath, "-that's my spot."
"And why is this spot so important to you?" He shuffled slightly, moving his hands along the cracks of the seat, "-You got something good stashed in 'ere?"
"Dear god," you huffed out a breath in defeat, "-Whatever. Enjoy your seat, asshole."
And with that, you spun on your heel and pulled yourself deeper into the library. Taking a breath in, you pulled yourself into a seat not too far from the original, but you were around the corner so you wouldn't have to look at his stupid face. You soured just at the thought.
You pulled open your chem book, and read through it -trying to figure out which ones you definitely missed, that way you could get the ballpark for what your grade might be. You really needed to know, to make sure your GPA stayed in the range for your dream university.
But, in the middle of it, you heard someone plop into the chair in front of you (it was a group of chairs, like for a group of people if necessary).
Before looking up, you spoke -sharply, "Do you mind?"
"Not at all."
Your eyes shot up at that familiar accent, and you frowned.
"You got the seat," you pointed out, bitterly, "-What the hell do you want now?"
"Your name," he answered simply.
You blinked, (what?) before settling back into your seat and flipping to the next page, "Yeah, no."
The man seemed to move forward, and unwillingly your eyes flickered to him (his curls moving with the motion), "Why not?"
"I don't give my name out to strangers," you retorted -flicking your eyes down to your book, "-especially not assholes."
"Don't know if I can change who I am," he smirked, "-but, I can work on the stranger part."
You frowned, eyeing him particularly, "Seriously, what do you want?"
"I already told you," he replied, fidgeting with something in his hands (you weren't paying attention), "-I'm Patrick, by the way."
"Well," you exhaled, sharply, and ignored his name, "-you're not getting it."
"Well," he repeated with the same sort of grin, "-I'll just have to work on that too, then."
You looked up at him again and squinted at him -trying to read him somehow. All he did was grin at you, a charming kind, of course, that made crinkles on his cheeks. You ignored the flutter in your chest that it gave you and darted your eyes back down to your book.
The next day, you were in better spirits. After studying for an entirely different class, you were pretty sure you aced that test. So, you weren't as pissed, thankfully. Until you went into the library to sit between classes like you always did.
You paused in your step and frowned.
The guy (Patrick, your mind treacherously noted) was sitting by your chair, mindlessly tapping his fingers along the arm of the chair. He wasn't in your chair, thankfully, but still, he was in the one beside it. Pointedly close.
You huffed out a breath, and moved toward the chairs, "What are you doing?"
"Sitting," he repeated.
You raised an eyebrow.
He seemed to take that as a repeat of the question -before saying, confidently (too confidently), "I'm studying for a test."
"You don't seem like the studying type," you retorted, throwing yourself into the chair and pulling out your laptop -realizing it was no use to try and get him to leave.
Patrick pointed out, "You don't even know me."
"And I don't intend to," you replied with ease, flicking your eyes to meet his, "-your point?"
He grinned the same bright one from before, amused maybe. Your heart skipped a beat, so you dropped your eyes back down to your laptop. He, on the other hand, didn't seem to look away.
"What's your major?" He asked, thoughtfully.
"I won't tell you my name," you leveled, scrolling through your online schedule for homework, "-but you think I'll tell you my major?"
"Well," he reasoned, "-a name is much more identifiable, but your major," he shrugged, "-not so much."
You eyed him again for a second, before saying, "What if you just want to look up my classes and hunt me down?"
Patrick smiled again, before asking, "What is your next class?"
"Why?" You ask, pointedly, "-So you can force me into talking to you again?"
"Preferably," he replied, grinning cheekily.
You raised an eyebrow, and bit your lip to pull down a smile that begged to quirk up, "I'm not telling you that either."
"What if I just follow you when you leave?" He questioned, curiously, "-Figure it out myself?"
"And what if I-" you smiled at him -patronizingly, "-call the campus police?"
He raised both eyebrows as if to say 'touché' without saying it out loud. You bit down another smile and moved back to your computer -pulling out your planner and jotting down dates.
"Your pissiness," he suddenly spoke, "-Are you often filled with boiling hatred?"
"No," you sigh out, before shooting him another patronizing smile, "-that's special just for you."
He laughed then, and something warm zinged down to your toes (you ignored it), "Do you seriously not know me?"
"Do you know how many Patricks exist in the world?" you point out, "-No, I don't know you."
"So you do remember my name," he smirked, patting along his lap with a mischievous gleam in his eyes.
You rolled your eyes but didn't say a word.
It ended up like that for the rest of the time, Patrick shooting questions now and then, and you shutting them down. His stupid smirk and low, rumbly, accented voice, you hated that he actually seemed kinda nice -all things considered.
But, as you stood up to leave, you decided on something.
"Literature," you said simply, gathering up everything into your bag.
He paused, shooting up his eyebrows, "What?"
"My next class," you answered, nonchalantly pulling your bag onto your shoulder, "-Intro to Literature."
Patrick grinned, bright and shiny, "Gen Ed?"
"Yeah," you answered, moving to put the last few things in your bag.
"Can I walk you?"
Your eyes snapped to him then, curiously -detailing the rather honest look, before answering solidly, "No."
He burst into laughter then, throwing his head back against the chair -you mindlessly watched his curls fall back with the motion and then snapped your eyes away.
"Same time tomorrow then?" He asked, still laughing a little bit (something in you twinkled).
"Nope," you exhale a breath, ignoring the disappointment that swirled into your chest, "-I'm not on campus tomorrow."
He seemed to falter for a second, "Do you live on campus?"
You raised a solid eyebrow, you really think I'd tell you that?
"Right, yeah, okay," Patrick conceded, holding up his hands in faux surrender, "-What days are you on campus?"
You paused, pressing your lips together, but something in you did it, "Mondays, Wednesdays and Thursdays."
He grinned a little brighter, "Are you here around the same time on Mondays?"
Something in your chest flipped, but even still, you answered, "That's what you have to figure out. Not me."
And then, you spun on your heel and walked out of the library. His laughter trailed out behind you, and if you had a small little smile on your face at the noise, that was only for you to know.
Monday came, and you woke up early and made your way to campus -the first class of the day was at the crack of dawn. You physically despised it, but so is the schedule of a college student. Plus, you still worked, so the earlier the better for your schedule -didn't mean it didn't suck though.
Sipping on your drink, you wandered back toward the cafeteria -crossing the main connecting area, where everything led to. There was a baseball game going on, not an official one by the looks of it, in the grass. Your eyes hinged on the game for a few seconds, the echoes of laughter shooting toward your ears. It looked fun, but you weren't too invested in being outside for that long. Before you could look away though, your eyes caught on a familiar frame.
Patrick.
His hair was tied back, and he was wearing a pretty bland tank top (just grey), with some typical jeans. With his hair pulled back, you could see his jaw more distinctively -the sharp lines clear from even this far away. (Not that you were looking.) The sun bore down on them but all of the players seemed to be happily distracted. And you kinda were too.
You pursed your lips, for a moment, and looked forward again after a breath, heading toward the cafeteria again confidently.
Before you could get very far, though, you heard a familiar accent.
"Hey!" He yelled, a little distant -footsteps following his voice, "-Hey!"
At first, you weren't sure if he was talking to you, so you kept moving.
"Shit, I don't know what to call you," he called out, breathless and much, much closer.
You spun on your heels with furrowed brows, and met his eyes over a few people's heads. The grin that swallowed his face whole should've been criminal, bright and twinkly and... charming.
Before you could say anything, he was by your side with heavy breaths -assumedly from playing baseball and getting over to you. Leaning over slightly, he leveled out heavy breaths. You were almost concerned enough to offer him water, but he seemed to settle himself before you could.
"Hi," he echoed, "-'Ve been looking for you all morning, what time did you get here?"
You blinked, all morning?
"I get here early, 7, and immediately go to class," you answered, a little blankly (looking for you, looking for you, looking for you).
"Oh," he paused, "-I got here at 8. There's classes at 7?"
"Obviously," you respond, because you did in fact just say it.
"Did you-" Patrick started, before pursing his lips together, "-Are you going to the library now?"
You furrowed your eyebrows, "No, I'm going to the cafeteria to eat between classes. Why?"
"I'm actually quite hungry myself," he avoided the question, "-Do you mind if I tag along?"
"What about your game?" You furrowed your eyebrows even further -eyeing him curiously.
"'S just to fill time," he explained, "-It's nothing serious. They're sure to find someone to fill in for me."
You flicker your eyes along his face, trying to read him. What's your prerogative?
After a moment, you come up with nothing and instead, just turn on your heel -leading the way to the cafeteria.
"I'm taking that as a yes, then?" Patrick called out from behind you, catching up and matching your stride with ease (despite you making no move to slow down).
You decidedly don't answer him, and say something focused elsewhere -eyeing him as you walk forward, "Do you always stalk people this much?"
Patrick laughed, catching your eye with his warm brown ones (they were almost sparkly under the sun of the day), "Only the ones that blindly hate me."
You pressed your lips together in a flat line (trying not to give anything away), "I didn't say that I hated you."
His face lit up at the words (and you couldn't decide if you regretted it or not), "Well, you could've convinced me."
You roll your eyes, and keep walking forward, "Not telling you my personal information isn't... hating you."
"I'm not sure not introducing yourself is exactly anything but hatred," he argued back, fluidly.
"I just told you that I don't hate you," you point out, "-so it isn't."
"Does that mean you'll eventually tell me your name?" Patrick asked, curiously.
You turned to him, flicked your eyes over him, and then looked forward again, "Maybe on good behavior."
He burst into laughter, brown eyes set on your face, "You're quite an enigma, you know that?"
"And you're not half the mystery you portray," you fire back, naturally, with the flow of the conversation.
He grinned at that, eyes shining with something you couldn't quite label, "You know, I don't think I've met a person like you. You're fearless in like a-" he motioned with his hands, "-casual way."
"I'm not fearless," you argue, approaching the door to the cafeteria, "-I'm just confident."
"Do they not go hand-in-hand?" Patrick offers, getting to the door before you and promptly holding it open for you -unflinchingly.
Something warm stirs in your stomach at the gesture (and his woodsy scent that brushes your nose as you walk past him), but you ignore it, "You can be certain and still be afraid."
"But knowing you're right doesn't necessarily mean-" Patrick followed you in, matching your stride again, as if it's natural, "-that you're confident."
You furrow your eyebrows, genuinely intrigued, "What do you mean?"
He paused, maybe a little shocked by your attentiveness, "Plenty of people know they're right and still concede to someone else because they don't want to fight it. You-" he pointed at you, "-will fight it."
"Well," you purse your lips, avoiding his eye contact, "-maybe I'm only like this with you."
"You," Patrick paused, "-You're not this fiery ball of rage with anyone else?"
You eye him for a second, before saying flatly, "Maybe."
"All of this seething hatred and impressive indifference just for me?" He grins, the big teeth-showing kind, "-I'm touched really. Because I am special to you in some weird kinda twisted way-"
Before you can stop yourself, you let out a laugh at his words -just a quick one. Barely there.
But you could still see the delight smooth along his face, and just knew he caught it.
"How much of that have you been holding back?" He tilted his head curiously, before continuing to push it, smirking, "-Oh I bet you think I'm hilarious."
Your heart skipped a beat at the smirk, and you simply pressed your lips together and turned on your heel to the food counter. There wasn't even a second before you heard footsteps following you.
"You're not denying it, you know," he called after you, close on your tail.
You peer over the selection of food, eyeing the different items thoughtfully, "But I didn't confirm it either."
"Still not denying it," Patrick hummed, sing-songy.
"You know," you turn to him (mindlessly noting that he is very close), sharply, "-someone can have one good joke and still be unfunny."
He leaned forward slightly, eyes set on yours -challenging, "Then tell me why it came out like you were holding it back?"
You blinked at him, once and then twice, the sudden closeness sent a shock through your brain and the challenging tone of his voice nearly gave you full-body shivers. You can't find words to say, and you can nearly see it processing on Patrick's face (the way that he had made your mind melt for a moment), so you turn to the counter and point at something random for them to pick out for you.
The woman eyes the two of you suspiciously, but still diligently pulls out a to-go plate and piles the... mashed potatoes onto it.
"Oh my god," he finally says after a moment (you ignore it).
You go through a few other items, and the woman gathers them onto the plate. You pay, grab your plate-
"You like me," Patrick retorts, and you're not even looking at him but you can tell he's got a shit-eating grin.
Your brain malfunctions for a moment, but you step toward the tables and fire back (on autopilot), "I won't even tell you my name."
He's hot on your trail, following you diligently, "You're avoiding the question."
You spin to him, and reply -sharply, "You didn't ask a question."
His eyes flicker along your face, taking you in (you want to squirm but you steel yourself in place -your eyes now challenging), and then he grins so bright that you'd need sunglasses in any other scenario.
"Oh, you're really into me," he continues, low, gravelly, accented voice rumbling through your ears.
You screw up your face into something defiant, roll your eyes, and turn back to slide into a table. Patrick follows you like a lost puppy. Well, an incredibly arrogant lost puppy.
"You're still not denying it," he slides into the chair beside you and you hate the way your brain swims at the woodsy smell that brushes your nose.
"'Thought you were hungry," you say, simply (avoiding the question and decidedly not denying).
"It was very obviously a ploy," Patrick chimed back, with natural ease -tilting his head slightly and looking at you with twinkling eyes, "-They had pizza out there for all the players. I've already eaten."
Your fork froze for a millisecond (even still, you were sure he caught it), and after a moment, you pulled it to your lips. Maybe conquering both of your lack of response and the way your mind lit up at the idea of 'he just wanted to see me'.
His smile and eyes seemed to soften slightly, as he leaned his head down to catch your eye and guide it back up to your natural gaze (your heart skipped a beat). His brown eyes were soft and if you were honest, maybe a little affectionate.
"What's your name?" He finally said after a soft few moments.
And just like that, for you, the moment snapped, and you rolled your eyes -turning back to your food.
"Oh, come on," Patrick tried to catch your gaze again, "-Look, I'll tell you. Patrick Verona. That's my name-"
You bit down a smile, as he motioned to you with his hands.
"-Now, your turn, tell me yours."
You raised an eyebrow.
Patrick let out a half-laugh, before leaning forward slightly on the table -not quite a breath away, but certainly closer.
"You're so stubborn," he laughed, "-I'll beg. You want me to beg?"
You can't help but let the smile slip onto your lips then, "Why would you beg for my name?"
"Because I want it," he pointed out, still grinning "-Because I want to know you, and personally, I think it should start with a name."
Your heart fluttered in your chest, and you let your fork hang there on the path to your face. You took a moment, scampered your eyes along his face (dark brown eyes so incredibly soft, curls coming down from where he put them up in individual tendrils). Your resolve was weakening, it was really and truly broken under Patrick Verona's hand.
Stupid pretty boys-
"Y/N," you said finally (quieter than intended), immediately pulling a bite to your mouth.
Patrick blinked, "What?"
"'S my name," you explain -shortly, moving a hand in front of your mouth as you chew, "-Y/N."
His eyes lit up at the words, that stupid charming grin smoothing onto his face as he repeated, softer than expected, "Y/N."
You shove down the fluster that begs to climb up your cheeks at his accented voice saying your name. It's something you'd never really thought about but now that it's said, you probably should've thought about it.
Patrick leaned back in his chair, eyes still set on you. He was still grinning, as he said simply, "Suits you."
You furrow your eyebrows, "What's that supposed to mean?"
He raises his hands in faux surrender, laughing to himself, "Jesus, you're a true ball of rage, you know 'at?"
"I'm not-" you huff out, and take a deep breath in, "-I'm not mad."
"Defensive then," he mends, "-You act as though I'm about to strike any minute."
You pursed your lips, "Whose to say you aren't?"
"Me," Patrick laughs, "-This entire conversation. The way I've acted around you since the beginning-"
"Oh, shut up," you roll your eyes, unable to stop the smile creeping onto your lips, "-you were an asshole once."
He groaned, but something like amusement was twinkling in his eyes, "You are the most stubborn human being on this earth-"
"You took my spot," you interrupt, sturdy.
"-It's public property," Patrick argued back, "-and how was I supposed to know it was yours before I sat in it?"
You paused, for a moment, before saying, "You couldn't. But, you could have given it to me when I asked."
"And then we wouldn't be here," he explained, now fully grinning, "-and wouldn't that just be such a bore."
Your eyes swam over his face a moment, Patrick Verona. And his dumb persistence. And his stupid handsome face-
God.
You let out a long sigh, picking around at your food. Eyes watching the swirl of your fork, you debate a few different things to say. Finally, after a few spare seconds, you made up your mind.
"Yeah," you hum, flickering your eyes up to his, "-it would."
Patrick grinned, big and bright and twinkly (you felt your heart skip a beat in your chest). His eyes, the deep brown that if you weren't careful you could stare at for way too long, were soft but still sort of happy, eager. Definitely eager.
And maybe, just maybe, you could get used to-
"I told you I could work on the 'stranger' thing," he suddenly said, smirking, "-You never should've doubted me."
"What?" You raised an eyebrow, confused.
"You said-" Patrick explained, "-you don't give your name out to strangers. And I said I could work on that part-"
You level a look at him.
"-And look, I did," he continued, before adding with a smirk, "-I have successfully escaped the cavernous barrier, deeper than the ocean I'd say, that walls you off from any poor soul who wishes to know you-"
"You're really pushing it, Verona," you chime back, fiery (but not quite all the way).
"What?" He raised his eyebrows, like he said nothing at all to warrant the reaction, "-You can't tell me that it's not like pulling teeth getting to know you. Or trying to anyway-"
You press your lips onto a flat line, "Wow, you must be a sort of masochist, then?
He faltered for a second, before laughing a little, "Oh absolutely, I chase the high of you ignoring me for 2 hours straight every day."
You rolled your eyes, biting down a smile, "I despise you."
"Better that than indifferent," he responded with ease, "-I prefer you feeling something rather than nothing at all."
"Oh my god-"
It continued like that, a back and forth, as you finish eating your mediocre cafeteria lunch. The silence is sparse but not uncomfortable when Patrick isn't running his mouth, that is. It was nice. Insanely nice. You'd probably never had as much fun on this campus as you did with him, just in general, but...
"Same time Wednesday?" He poses with a cheeky grin, leaning onto one hand against the table -closer to you than before.
You felt something warm swirl into your stomach, as your eyes flickered over his face. He was still smiling, like he wasn't able to stop when he was here with you. And something in you never wanted to see it go away anyway.
So, with a slight head tilt and a brighter grin than what you'd let slip past all day, you repeated.
"Same time Wednesday."
115 notes · View notes
skyeqt · 18 days ago
Text
I wrote a quine, without strings, in a calculator
Okay so I should probably clarify some things, the calculator in question (dc) is more of a "calculating tool", it is built into most linux distributions, and it is a command line tool. I should also clarify "without strings", because dc itself does support strings, and I do actually use strings, however, I do not use string literals (I'll explain that more later), and I only use strings that are 1 character long at most.
So first of all, why did I decide to do this, well, this all started when I found a neat quine for dc:
[91Pn[dx]93Pn]dx
If you're curious about how this works, and what I turned it into, it'll be under the cut, for more technical people, you can skip or skim the first text block, after that is when it gets interesting.
So first of all, what is a quine, a quine is a computer program that outputs its own source code, this is easier said than done, the major problem is one of information, the process of executing source code normally means a lot of code, for a little output, but for a quine you want the exact same amount of code and output. First of all, let's explain dc "code" itself, and then this example. Dc uses reverse polish notation, and is stack-based and arbitrary precision. Now for the nerds reading this, you already understand this, for everybody else's benefit, let's start at the beginning, reverse polish notation means what you'd write as 1+1 normally (infix notation), would instead be written as 1 1 +, this seems weird, but for computers, makes a lot of sense, you need to tell it the numbers first, and then what you want to do with them. Arbitrary precision is quite easy to explain, this means it can handle numbers as big, or as small, or with as many decimal points as you want, it will just get slower the more complex it gets, most calculators are fixed precision, have you ever done a calculation so large you get "Infinity" out the other end? That just means it can't handle a bigger number, and wants to tell you that in an easy to understand way, big number=infinity. Now as for stack based, you can think of a stack a bit pile a pile of stuff, if you take something off, you're probably taking it off the top, and if you put something on, you're probably also putting it ontop. So here you can imagine a tower of numbers, when I write 1 1 +, what I'm actually doing is throwing 1 onto the tower, twice, and then the + symbol says "hey take 2 numbers of the top, add them, and throw the result back on", and so the stack will look like: 1 then 1, 1, then during the add it has nothing, then it has a 2. I'm going to start speeding up a bit here, most of dc works this way: you have commands that deal with the stack itself, commands that do maths, and commands that do "side things". Most* of these are 1 letter long, for example, what if I want to write the 1+1 example a little differently, I could do 1d+, this puts 1 on the stack (the pile of numbers), then duplicates it, so you have two 1s now, and then adds those, simple enough. Lets move onto something a little more complex, let's multiply, what if I take 10 10 * well I get 100 on the stack, like you may expect, but this isn't output yet, we can print it with p, and sure enough we see the 100, I can print the entire stack with f, which is just 100 too for now, I can print it slightly differently with n, I'll get into that later, or I can print with P which uhhhh "d", what happened there? Well you see d is character 100 in ASCII, what exactly ASCII is, if you don't know, don't worry, just think of it as a big list of letters, with corresponding numbers. And final piece of knowledge here will be, what is a string, well it's basically just some text, like this post! Although normally a lot shorter, and without all the fancy formatting. Now with all that out of the way, how does the quine I started with actually work?
From here it's going to get more technical, if you're lost, don't worry, it will get even more technical later :). So in dc, you make a string with [text], so if we look at the example again, pasted here for your convenience
[91Pn[dx]93Pn]dx
it makes one long string at the start, this string goes onto the stack, and then gets duplicated, so it's on the stack twice, then it's executed as a macro. In technical language, this is just an eval really, in less technical language, it just means take that text, and treat it like more commands, so you may see, it starts with 91P, 91 is the ASCII character code for [, which then gets printed out, not coincidentally, this is the start of the program itself. Now the "n" that comes afterwards, as I said earlier, this is a special type of print, this means print without newline (P doesn't use newlines either), which means we can keep printing without having to worry about everything being on separate lines, now what is it printing? Well what's on top of the stack, oh look, it's the copy of the entire string, which once again not coincidentally, is the entire inside of the brackets, so now we've already printed out the majority of the program, now dx is thrown on the stack, which as you may notice is the ending of the program, but we won't print it yet, we'll first print 93 as a character, which is "]", and then print dx, and this completes the quine, the output is now exactly the same as the input. Now, I found this some time ago, and uncovered it again in my command history, it's interesting, sure, but you may notice it's not very... complicated, the majority of the program is just stored as a string, so it already has access to 90% of itself from the start, and just has to do some extra odd jobs to become a full quine, I wanted to make this worse. I started modifying it, doing some odd things, which I won't go into, I wanted to remove the numbers, replacing it entirely with calculations from numbers I already have access to, like the length of a string, this wasn't so hard, but then I hit on what this post is about "can I make this without using string literals"
Can I make this without using string literals?
Yes, I can! And it took a whole day. I'll start by explaining what a string literal is, but this will largely be the end of my explaining, from here it's about to get so technical and I don't want to spend all day explaining things and make this post even longer than it's already going to be. A string literal is basically just the [text] you saw earlier, it's making a string by just, writing out the string. In dc there's only 1 other way to make a string, the "a" command, which converts a number, into a 1 character string, using the number as an ASCII character code. Strings in dc are immutable, you can only print, execute, and move them around with the usual stack operations, you cannot concatenate, you cannot modify in any way, the only other things you can do with a string, is grab the first character, or count the characters, but as I just explained, our only way to make strings creates a 1 character string, which cannot be extended, so the first character is just, the entire thing, and the length is always 1, so neither of these are useful to us. So, now we understand what the restriction of no string literals really is (there are more knock on restrictions I'll bring up later), let's get into the meat of it, how I did it.
So I've just discussed the way I'll be outputting the text (this quine will need text, since all the outputting commands are text!), with the "a" command and the single character strings it produces, let's now figure out some more restrictions. So any programmers reading this are going to be horrified by what I'm about to say. If I remove string literals, dc is no longer Turing Complete, I am trying to write a quine in a language (subset) that is not Turing Complete, and can only output 1 character at a time**. You can't loop in dc, but you can recurse, with macros, which are effectively just evaling a string, you can recurse, since these still operate on the main stack, registers, arrays, etc, they can't be passed or return anything, but this doesn't matter. Now I cannot do this, because if I only have 1 character strings via "a" then I can't create a macro that does useful work, and executes something, since that would require more than 1 command in it. So I am limited to only linear execution***. Now lets get into the architecture of this quine, and finally address all these asterisks, since they're finally about to be relevant, I started with a lot of ideas for how I'd architect these, I call these very creatively by their command structure, dScax/dSax, rotate-based execution, all-at-once stack flipping, or the worst of them all, LdzRz1-RSax (this one is just an extension of rotate-based execution), I won't bother explaining these, since these are all failed ideas, although if anybody is really curious, I might explain some other time, for now, I'll focus on the one that worked, K1+dk: ; ;ax, or if you really want to try to shoehorn a name, Kdkax execution, now, anybody intimately familiar with dc, will probably be going "what the fuck are you doing", and rightly so, so now, let's finally address the asterisks, and get into what Kdkax execution actually means, and how I used it.
*"Most commands are 1 character long, but there are exceptions, S, L, s, l, :, ; and comparisons, only : and ; are relevant here, so I won't bother with the rest, although some of the previous architectures used S and L as you may have seen. : and ; are the array operations, there are 256 arrays in dc, each one named after a character, if I want to store into array "a" I will write :a, a 2 character sequence, same for loading from array "a" ;a, I'll get into exactly how these work later **I can only output 1 character at a time with p, P, and n, but f can output multiple characters, the only catch being it puts a newline between each element of the stack, and because I can only put 1 character into each stack element, it's a newline between each character for me (except for numbers). I'll get into what this means exactly later ***I can do non-linear execution, and in fact, it was required to make this work, but I can only do this via single character macros, which is, quite the restriction to put it lightly
So I feel like I've been dancing around it now, what does my quine actually look like, well, I wanted to keep things similar to the original, where I write a program, I store it, then I output it verbatim, with some cleanup work. However, I can't store the program as strings, or even characters, I instead need to store it as numbers, and the easiest way to do this, is to store it as the char codes for dc commands, so if I want to execute my 1d+ example from before, I instead store it as 49 100 43, which when you convert them back to characters, and then execute them in sequence, to do the same thing, except I can store them, which means I can output them again, without needing to re-create them, this will come in handy later. So, well how do I execute them, well, ax is the sequence that really matters here, and it's something all my architectures have in common, it converts them to a character, then executes them, in that order, not so hard, except, I'm not storing them anymore, well then if you're familiar with dc, you might come across my first idea, dScax, which, for reasons you will understand later, became dSax, this comes close to working, it does store the numbers in a register, and execute them, but this didn't really end up working so well. I think the next most important thing to discuss though, is how I'm outputting, as I mentioned earlier "f" will be my best friend, this outputs the entire stack, this is basically the whole reason this quine is possible, it's my only way of outputting more characters from the program, than the program itself takes up, since I can't loop or recurse, and f is the only character that outputs more than 1 stack element at once, it is my ticket to outputting more than I'm inputting, and thereby "catching up" with all the characters "wasted" on setup work. So now, as I explained earlier, f prints a newline between each stack element, and I can only create 1 character stack elements, and because in a quine the output must equal the input, this also means the input must equal the output. And because I just discovered an outputting quirk, this means my input must also match this quirk, if I want this to be a quine, so, my input is limited to 1 character, or 1 number, per line, since this is the layout my stack will take, and therefore will be the layout of my output. So what does this actually mean, I originally thought I couldn't use arrays at all, but, this isn't true, the array operations are multiple character sequences yes, but turns out, there actually are multiple characters per line, there's also a linefeed character. And since there is an array per ASCII character, I am simply going to be storing everything in "array linefeed"! So now, with all of this in mind, what does the program actually look like.
Let's take a really simple example, even simpler than earlier, let's simply store 1 and then print it, this seems simple enough, 1p does it fine, but, lets convert it to my format, and it's going to get quite long already, in order to prevent it getting even longer, I'll use spaces instead of newlines, just keep in mind, they're newlines in the actual program
112 49 0 k K 1 + d k : K 1 + d k : 0 k K 1 + d k ; K 1 + d k ; 0 k K 1 + d k ; a x K 1 + d k ; a x
now, what the fuck is going on here, first of all, I took "1p" and converted both characters into their character codes "49 112" and then flipped them backwards (dw about it), then, I run them through the Kdkax architecture. What happens is I initialise the decimal points of precision to 0, then, I increment it, put it back, but keep a copy, and then run the array store, keep in mind, this is storing in array linefeed, but what and where is it storing? Its index is the copy of the decimal points of precision I just made, and the data it's storing at that index, is whatever comes before that on the stack, which, not coincidentally, is 49, the character code for the digit "1", then I do the same process again, but this time, the decimal points of precision is 1, not 0, and the stack is 1 shorter. So now, I store 112 (the character code for p), in index 2 of array linefeed, now you may notice, the array is looking the exact same as the original program I wanted to run, but, in character code form, it is effectively storing "1p", but as numbers in an array, instead of characters in a string. I then reset the precision with 0k, and start again, this time with the load command, which loads everything back out, except, now flipped, the stack originally read 49 112, since that's the order I put them on, the top is 49, the last thing I put on, but after putting them into the array, and taking them back out, now I'm putting on 112 last instead, so now the stack reads 112 49, which happens to be the exact start of the code, this will be important later. For now, the important part is, the numbers are still in the array, taking them out just makes a copy, so, this time I take them out again, but rather than just storing them, I convert them to a character, and then execute them, 49 -> 1 -> 1 on the stack, 112 -> p -> print the stack, and I get 1 printed out with the final x. Now this may not seem very significant, but this is how everything is going to be done from here on out.
So, what do I do next? Well now's time to start on the quine itself, you may have noticed in the last example, I mentioned how at one point, the stack exactly resembles the program itself, or at least the start of it, this is hopefully suspicious to you, so now you may wonder, what if my program starts with "f" to print out the entire stack? Well, I get all the numbers back, i.e. I get the start of the file printed out, and this will happen, no matter how many numbers (commands) I include, now we're getting somewhere, so if I write fc at the start of my program (converted into character codes and then newline separated) then I include enough copies of the whole Kdkax stuff to actually store, load, and execute it, then I can execute whatever I want, and I'll get back everything except the Kdkax stuff itself, awesome! So now we come onto, how do I get back the "Kdkax stuff", and more importantly, what are my limitations executing things like this, can I just do anything?
Well, put simply, no, I cannot use multicharacter sequences, and I actually can't this time, because it's being executed as a single character macro, I don't have a newline to save me, and I just get an error back, so okay that's disappointing. This multicharacter sequence rule means I also can't input numbers bigger than 1 digit, because remember, the numbers get converted into characters and then executed, and luckily, executing a number, just means throwing it on the stack, so I'm good for single digit numbers. Then in terms of math (I know, this is a post about a calculator and only now is the maths starting), I can't do anything that produces decimals, since the digits of precision is constantly being toyed with, and I also can't use the digits of precision as a storage method either, because it's in use. I can actually use the main stack though! It's thankfully left untouched (through a lot of effort), so I'm fine on that front. Other multicharacter sequences include negative numbers, strings (so I can't cheese it, even here), and conditionals.
So it was somewhere around here, I started to rely on a python script I wrote for some of the earlier testing, and I modified it to this new Kdkax architecture when I was confident this was the way forwards. It converts each character into a character code, throws that at the start, and then throws as many copies of the store, load, and execute logic as I need to execute the entire thing afterwards. This allows me to input (mostly) normal dc into the input, just keeping in mind that any multicharacter sequences will be split up. So now I can start really going, and I'll speed up from here, effectively, what I need to do, is write a dc program, that can output "0 k", then "K 1 + d k :" repeated as many times as there are characters in my program, then "0 k" again, then "K 1 + d k ;" repeated just as many times, then "0 k" again, then "K 1 + d k ; a x" also repeated just as many times, without using strings, multicharacter sequences, loops, branches, recursion, any non-integer maths, with a newline instead of a space in every sequence above. Doable. The program starts with fc, like I mentioned, this prints out all the numbers at the start, and leaves us with a clean stack, I'll explain in detail how I output the "0 k" at the start, and leave the rest as an exercise to to the reader. I want to do this by printing the entire stack, so I want to put it on backwards, k first, k is character code 107 in decimal, and I can't input this directly, because I can't do anything other than single digit numbers, so maths it is, here I abuse the O command, which loads the output base, which is 10 by default, and I then write "OO*7+a", which is effectively character((10*10)+7) written in a more normal syntax, this creates "k" on the stack, and then I can move onto 0, for which I write "0", since a number just puts itself on the stack, no need to create it via a character code, I can just throw it on there, keep in mind this will all get converted to 79 79 42 55 43 97 48, but the python script handles this for me, and I don't need to think about it. The stack now reads "0 k" and I can output this with f, and clear the stack, I then do the same deal for "K 1 + d k :", the next "0 k", "K 1 + d k ;" but here I do something a little different, because I want to output "K 1 + d k ; a x" next (after the "0 k" again), I don't clear the stack after outputting "K 1 + d k ;", and instead, I put "a x" on the stack, and then use the rotate stack commands to "slot it into place" at the end, this is a neat trick that saves some extra effort, it makes printing the "0 k" in between more difficult, but I won't get into that. For now the important part, is the output of my program now looks something like this "(copy of input numbers) 0 k K 1 + d k : 0 k K 1 + d k ; 0 k K 1 + d k ; a x" this is amazing, this would be the correct output, if my program was only 1 character long at this point, now keep in mind I'm writing non-chronologically, so my program never actually looked like this, but if you're following along at home you should have this at this point:
fcOO*7+a0fcaO5*8+aOO*7+aOO*aO4*3+aO4*9+a355**afcOO*7+aOO*aO4*3+aO4*9+a355**af0nOanOO*7+anOanOO*2O*+aOO*3-a08-R08-Rf
definitely longer than 1 character, you might think at this point, it's just a matter of spamming "f" until you get there, but unfortunately, you'll never get there, every extra "f" you add, requires an extra copy of the store, load, execute block in the program, so you're outpaced 3 to 1, so what do you do about this? You print 4 at once! I want the stack to look like "K 1 + d k : K 1 + d k : K 1 + d k : K 1 + d k :" and similarly for the other steps, and then I can spam f with greater efficiency! This was somewhat trivial for the first 2, but for the ax, because I'm using the rotate to push it at the end, I need to do this 4 times too, with different rotate widths, not too hard. And now, I can finally get there, but how many times do I spam f? Until my program is exactly 3/4s printing on repeat, which makes sense if you think about it, and below, is finally the program I ended up with
fcOO*7+a0fcO5*8+aOO*7+aOO*aO4*3+aO4*9+a355**aO5*8+aOO*7+aOO*aO4*3+aO4*9+a355**aO5*8+aOO*7+aOO*aO4*3+aO4*9+a355**aO5*8+aOO*7+aOO*aO4*3+aO4*9+a355**affffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcOO7+a0fcO5*9+aOO*7+aOO*aO4*3+aO4*9+a355**aO5*9+aOO*7+aOO*aO4*3+aO4*9+a355**aO5*9+aOO*7+aOO*aO4*3+aO4*9+a355**aO5*9+aOO*7+aOO*aO4*3+aO4*9+a355**affffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0nOanOO*7+anOanOO*2O*+aOO*3-a08-R08-ROO*2O*+aOO*3-a082-R082-ROO*2O*+aOO*3-a083-R083-ROO*2O*+aOO*3-a084-R084*-Rffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
I say finally, but this is actually pre-python script! The final program I actually ended up with will instead be included in a reblog, because it really needs its own cut. But anyway, this was how I wrote a quine, for a calculator, without using string literals.
4 notes · View notes