#JavaScript Output
Explore tagged Tumblr posts
webtutorsblog · 2 years ago
Text
Start Your JavaScript Journey with WebTutor
In the world of web development, JavaScript has emerged as an essential programming language. Its versatility, ease of use, and ability to interact with HTML and CSS make it a powerful tool for creating dynamic and interactive websites. In this blog, we will explore the fundamental concepts of JavaScript, from its basic syntax and output to variables, operators, and more. Whether you're a beginner or a seasoned developer, there's something for everyone to learn and apply. Additionally, we'll introduce you to an excellent resource, webtutor.dev, where you can further enhance your JavaScript skills.
JavaScript Output
JavaScript allows developers to communicate with users by generating output in various ways. The most common method of output is using the console.log() function. It prints messages or data to the browser's console, which is useful for debugging and understanding what's happening in your code.
JavaScript Syntax
The syntax of JavaScript is quite user-friendly and similar to many other programming languages. Here are a few key points to remember:
Statements: JavaScript code is made up of statements, which can be declarations, assignments, function calls, loops, etc.
Case Sensitivity: JavaScript is case-sensitive, so variables myVar, myvar, and MYVAR are considered different.
Semicolons: While optional, it's a good practice to end statements with semicolons to avoid potential issues.
Whitespace: JavaScript ignores whitespace, so you can use spaces, tabs, and newlines for code formatting.
JavaScript Comments
JavaScript Comments are essential for code documentation and explanation. JavaScript supports both single-line and multi-line comments. Single-line comments start with //, and multi-line comments are enclosed between /* and */.
JavaScript Variables
Variables in JavaScript are used to store data values. They are declared using the let or const keyword. let allows reassignment, while const creates a constant that cannot be reassigned.
JavaScript Operators
Operators are symbols used to perform operations on variables and values. JavaScript supports various types of operators:
Arithmetic Operators: Used for basic arithmetic operations like addition, subtraction, multiplication, etc.
Comparison Operators: Used to compare values and return true or false based on the comparison.
Logical Operators: Used to combine multiple conditions and determine the overall truth value.
Assignment Operators: Used to assign values to variables.
Ternary Operator: A shorthand way of writing conditional statements.
Conclusion
JavaScript is the backbone of modern web development, enabling you to create dynamic and interactive websites that engage users effectively. By mastering JavaScript's syntax, output, comments, variables, and operators, you will have a strong foundation to build upon. Remember, continuous learning is the key to staying relevant and growing as a developer.
So, start your JavaScript journey today, and do not forget to visit webtutor.dev for an enriching learning experience that will take your skills to new heights. Happy coding!
0 notes
friedfriedchicken · 8 months ago
Text
TFRarePairingFest 2024
October 14th = Head Injury
Ft. Breakdown/Soundwave (Humanformers edition, fanfic inspired)
Tumblr media
Soundwave.execute(check_up); var checkup_patient = Breakdown;
18 notes · View notes
orcelito · 3 months ago
Text
So i did finish the lab. Pretty damn late, but I finished it.
Tumblr media Tumblr media
This should be testament enough to my general state of mind by this point. Yes, I did turn it in like this.
0 notes
codeonedigest · 2 years ago
Video
youtube
File Upload Download Microservice in Nodejs Javascript | API for Multipa... Full Video Link       https://youtu.be/Kyi6sYj9ImgHello friends, new #video on #nodejs #javascript #microservices for #filedownload and #fileupload #multer #multipart #formdata #multipartformdata #javascript #projeect #application #tutorial #examples is published on #codeonedigest #youtube channel.  @java #java #aws #awscloud @awscloud @AWSCloudIndia #salesforce #Cloud #CloudComputing @YouTube #youtube #azure #msazure  #codeonedigest @codeonedigest  #nodejs  #nodejs #javascript #microservices #nodejstutorial #learnnodejs #node.js #nodejsfileupload #nodejsmulter #nodejsmulterfileupload #nodejsmulterimageupload #nodejsmicroservicesfileupload #nodejsmicroservicesfiledownload #nodejsapifileupload #nodejsapifiledownload #nodejsfileuploadapi #nodejsfileuploadusingmulter #nodejsfiledownload #nodejsfiledownloadapi #nodejsdownloadfilefromserver #nodejsmultipartfileupload #multerinnodejs
1 note · View note
wholesalemagnesiumoxide · 2 months ago
Text
The Simslops Afterword
hello everybody! thank you for reading my book. seeing people talk about it has been very gratifying & encouraging.
i was going to write this up essay style, but doing it as a q&a is more fun and still lets me cover everything i wanted to, so let's begin.
q&a
first off, a question from @aminoasinine which i'll address in parts:
I really enjoyed Simslops, and in particular I think the "dwarf fortress event log" style of writing is a great way to showcase the machine/algorithm aspect of it. What software was used for this? Did it have trouble keeping track of so many characters? I noticed the centipedes and other numbered masses were accurately tracked throughout the text, which is something that I know AI tends to struggle with. I'm also curious to know how much of the chapters' 'plot' was laid out in advance by the prompting, and whether any major events were the result of emergent narrative. In particular, the coffin + Maude's Salvation plot towards the end definitely felt like direct intervention on your part, but was the AI reacting to you inserting those things, or were you editing the text around them after the fact?
the simslops is the product of a custom program written in nodejs. the source code is available at the download page if you want to examine it in detail, but the core of the framework is as follows:
there are actors, items, and rooms with names and numerical flags.
there are actions, each defined by their conditions, effects upon the scene, and chance of being selected.
each chapter is defined by its starting conditions and available actions.
each round or tick (whatever you want to call it), a random available action is applied to the scene.
this is repeated until an action ends the scene or there are no more actions left to perform.
each action narrates itself when applied to a scene. for example, the source code for the "pick up an item" action looks like this:
Tumblr media
hopefully this is at least semi-intelligible if you don't know javascript. the first parameter defines what the action acts upon: in this case, an actor and an item. the second is the condition: the item must not already be held, and it must not have the pickupAttempted flag. the third is responsible for how the action affects the scene, and the string it returns is how the action is described in the text. when an actor goes to pick something up, if that something is immovable, this is noted. (otherwise every scene devolves into everybody struggling to pick up a couch.) if it's not immovable, the actor picks it up. the first case is described with "actor tries to pick up item, but it's hardly portable." (a reference to the inform 7 default responses) and the second with "actor picks up item." the fourth parameter says to multiply this action's weight by ten if the item in question has a description and has yet to be examined.
each action is defined similarly. a handful use grammars for more varied output, but the majority just have simple fill-in-the-blank sentences. all together there's nearly 6k lines of nodejs to define the whole book. this project started as a test case for this framework, actually. i was outlining a short story and hating it and had a thought: what if i wrote a program to generate an outline for me? then i could have a skeleton to work from and could get to the fun part, the actual writing. out of whimsy i decided to put some simpsons characters in a room and make them fuck. this is a more exhaustive test case than you'd expect. it handles solo actions (moaning) and pair actions (lustful looks & sex.) sex only happens when both participants are horny, which requires setting flags for each actor. kramer's appearance is an action not tied to anything in the scene, and giving birth is an action that creates new actors. a great deal of my motivation here (and in many other things) was "wouldn't it be funny / fucked up if..." but it also did its job of test case pretty well. once i added items, that necessitated inventories; theft & picking up & putting down all require certain types of checks.
it's funny that you mention emergent narrative, because i really think the simslops really became what it was in the telling. early in the process i became enamored with the image of one of the characters descending through text adventure geography, lost and alone. thus came the turn to pathos. i had read "does marge have friends" some time prior, which inspired maude's inclusion and the role she plays. from there i built things out with twin eyes toward thematics and "funny/fucked up". i do find it interesting to what extent all that was emergent from the implementation. it's a framework that tends towards reducing things to mush. a semantic satiation machine.
anyway, i hope this answers your question --- it's not LLM-based, it uses older, more "traditional" procgen techniques. the plot of each chapter is roughly scaffolded by the actions i attach to it. it's really incredibly authored; it's difficult for this framework to surprise me except by juxtaposition. under this framework it's also pretty trivial to track any number of actors. so, to answer this question from @zedogica:
how much of simslops was embellished from the original generated text? a few moments stood out to me
none of it. you can download the source and get your own personal simslops. the only human embellishment was done during development. in an ideal world, this would live on a server somewhere and everyone could download a unique generation. unfortunately, i don't have the knowhow for that kind of thing. (my understanding is that you need to do a lot when writing server-side code to make sure you don't expose a million security vulnerabilities.) i've contented myself with doing what i can client-side: releasing the source code & setting up the download button to give you one of five pre-generated outputs.
returning to aminoasinine's question:
I also really like the difference in language used during the Deviltongue chapters. It's interesting to see what changes when the tone is explicitly defined as 'horror' or 'scary', and how that seemingly translates to those bizarre compound words like tribulationmalice and torturefrenzy. I think it's my favorite chapter(s) in general because of how it takes a much different tone and hammers it into the same monotonous nothing as the other chapters despite its more 'active' and ostensibly 'less boring' setting than your standard centipede sex house. everything shakes and moans and howls with blood-malice, lymph and spines standing on end, over and over until it doesn't mean anything anymore. everyone and everything is trembling in fear of a grim finality bearing down that never actually comes, because nothing ever ends. It's the same nothing-emotion as all the unbearable passionate lust in the sex scenes, an emotional signifier that signifies absolutely nothing.
thank you! the strange compounds are a product of the aforementioned grammars, as are the shaking and moaning and howling. writing the dungeon & horror chapters made me realize i really like broad, dumb pastiches. there's something very satisfying about taking cliches and mangling them.
Anyway, the choice to have 'pet the dog' in every scene did not go unnoticed, I think the last three lines are my favorite part, and finally, I think every book from now on should open with a horoscope chart made from out of context quotes. Thank you for making this, I will be watching your neocities with great interest :)
thank you for reading it! two fun facts about the horoscopes:
each entry's text is taken from a random item description.
the dates are wrong, each offset by a day. due to my strong personal convictions i wished to stress that this novella in no way endorses the practice of astrology.
an anonymous question:
So Marge crying during the video game sequence show the reduction of feelings into simple fun, even though the human experiencing the games in question might feel other emotions when playing them. But what do the horror sections represent? I got the gist of most parts, but as I don’t engage with horror medium often I feel like the commentary is lost on me. What were you trying to say with the horror sections, in other words?
first: one of the major benefits of the framework i used here is that it's very good at creating unintended juxtapositions. the only prerequisite for weeping is if the actor in question is holding part of a corpse, but depending on the context, it can take on a number of different connotations.
second:
a lot of usamerican horror films (particularly aliens and predator) are sublimations of the anxieties surrounding the vietnam war. both are about big grizzled soldier guys getting picked off by an unseen yet omnipresent foe who can strike from anywhere. hell, one of them is even set in a jungle. slender: the eight pages, being a game about the Scary Getter following you around in a forest, feels of a type with these.
seymour skinner was a us soldier in the vietnam war.
in that vein, another anonymous question:
also I understand almost all of the references in the chicken’s names but how does sylvester stallone figure into colonialism?
one of sylvester stallone's two big roles is the rambo series, where he's a heroic us soldier rescuing prisoners of war in vietnam, repelling the soviets in afghanistan, or performing other jingoistic acts of horrendous violence. the other is rocky where he plays a white boxer (the "italian stallion") who's built up as a contender to the current reigning champion, Black boxer apollo creed. he's of a type with the other americana culture slop included, i think.
another question from aminoasinine:
Damn, I thought of another question right after I sent that long-ass ask. What was the thought process behind making The Bart such a minor part of the story? Is it out of a desire (or the AI's internal rules) not to have a child present in the gore/sex chapters, or is it more about how Bart as a character seems almost /more/ of a product or symbol than any of the other characters? Like, he can't really mingle with the other 'people' in this setting, because he is something beyond, having transcended any semblance of characterhood to become ONLY product? Is this the end state of every simslop, to eventually be reduced to a series of identical stimuli on a conveyor belt of endless content?
i settled on the cast of characters pretty early. homer and marge are obvious. ned is also pretty obvious. maude is the emotional core. "kramer bursts in" is a pretty common meme. and i had steamed hams edits on the brain, so seymour gets to come, too. i scaffolded out my story with a focus on these six and whatever pathos & resonance i could wring out of them.
i don't think i had any plans to include bart until i came up with that pun. "the work of bart in the age of mechanical reproduction." that + the factory itself is a very good illustration of the funny/fucked up philosophy & dichotomy. (i think i also had the bart doll from the trash meteor episode of futurama in mind.)
anyway, to answer your actual question: yeah, i didn't want to put bart in the main story because i didn't want to put a child in the mix, and he didn't fit in the outline i had drawn up. i think the intermissions pretty accurately capture the pathos of bart & milhouse, though. the funko pop scamp and the perpetual punching-bag.
this next question is from @where-your-eyes-dont-go:
I'm curious about the reason for "_ pets the dog" being such a frequent refrain in so many sections. I could read it a few ways— it's an action that's often used to humanize characters, and it occasionally does seem to give the characters more apparent personhood, the action almost automatically being interpreted by the reader as affection showcasing an internal life—but its repetition seems to force the reader to instead view it as just another merely automatic process. It also could be a bit of commentary on the common claim that a "pet the dog" button in video games automatically makes such games better. I'd love to know more about your thought process here.
early in the development process, i added "actor votes blue." as an inane flavor action. rqd suggested they pet the dog, and i thought it was brilliant. "can you pet the dog" is exactly the kind of empty posturing i want to satirize. i thought it would be best if the dog is never simulated otherwise. just as petting the dog is an empty gesture in games, in the simslops the dog only exists "in flavor", not mechanically. there is no dog actor or dog affection flag, it's just implied there's a dog around for each scene. the suggestion of something cozy and wholesome and cute happening without any actual substance. (and bob was there, too.)
(a friend had to dissuade me from adding "actor realizes why they're called Kojima games" as another flavor action.)
this anonymous question befuddled me a bit:
have you read Marge Simpson Anime?
"marge simpson anime... what in the world is marge simpson anime?" and then i looked it up and found a tumblr blog with a bunch of drawings of marge and went "oh yeah! marge simpson anime!" i haven't read it, but i've definitely seen it around, and i'm definitely at least in conversation with it.
(on the subject of things i'm in conversation with, i realized recently that i absolutely should have put too many cooks and the simpsons au where homer is in pain in the further reading section.)
a question from @theoretically-questionable:
I'm curious as to why the choices of both explicit sexual acts and disregard for consistent anatomy within said acts were made for Simslops; was it simply a transgression, influenced by the (surprising) amount of actual simpsons porn, or something else?
this one also befuddled me. my original intent had been to generate oddball descriptions of a consistent set of genitals, but, like. on further reflection, that super isn't borne out by the text. i think my mental image of things changed when i added the "adverbly-verbing" snowclone to the sex grammar. (score one for emergent narrative.) my initial motivation was that i think over-the-top, too-mechanical-to-be-erotic sex is a fun thing to write a generator for, and i find kramer and homer doing obscene things to each other amusing. the end result is a lot more mastaba snoopy in a way i really like.
here's a question from @txttletale:
why the simpsons? as opposed to, for example, family guy
i've had to think for a while on this. my instinctive response is "it was essentially random, an act of whimsy," but that's not a very good answer. surely something drew me to the simpsons, even if it was subconscious. let's try and peel it back a layer. my next theory has to do with pathos. it is very difficult to wring anything remotely poignant out of peter griffin. you put peter griffin in a scary cave and he goes "this reminds me of the time i was in the descent" and we get some inane cutaway gag. i can't imagine lois expressing anything more sincere than a scott the woz video. there's an obvious pathos to meg, the constant butt of the joke; treating her with any degree of seriousness gets you pathos in spades. similarly, that comic where chris griffin and bart simpson go to couples therapy is genuinely affecting. there's something there, but it's a very different something from what the simslops ended up being. (for one, i wouldn't feel comfortable doing all the centipede sex stuff if my principal characters are kids.) there's a similar issue with trying this with south park (which was also something i don't have much familiarity with). while the fandom has bafflingly devoted a great deal of time and energy to the emotional struggles of those little weirdos, i don't really see much potential there.
on the other end, we have futurama, a show with perhaps too much emotional weight to go in the blender in the same way. like, there are the episodes with fry's dog and fry's brother and leela's parents. similarly, bob's burgers and bojack horseman (and i'm sure many other shows) draw their characters too realistically. the simpsons hits a sweet spot. its characters are cartoon-enough, commodified-enough, and emotional-enough. they're in the goldilocks zone along all these axes.
in the simpsons movie, there's a bit where bart and ned go fishing. bart messes up somehow, ned goes to assist, and bart flinches away, expecting to be strangled. what was once a comedy routine, a subversion of the "father-knows-best" sitcom family, is treated with real emotional weight.
how did they ever come back from that? by the end of the film homer had redeemed himself as a person and as a father. it was the emotional climax of the movie or whatever. roll credits. there were a million billion more seasons and despite the increasing age of the voice cast, more simpsons are extruded every day. why bother? the rotten heart was laid bare nearly two decades ago.
finally, a question from @fattyopossum:
have you seen any interpretations of it youd consider like. unexpected, in either a good ro bad way? any takes on it now that its been out that youw erent expecting people to get or new interpretations people brought to it that really resonated with you
a lot of the thematic weight of the simslops feels post-hoc to me, like a new interpretation that wasn't there when i wrote it. again, it really became what it was in the telling; technical decisions lead to thematic weight. all characters who have sex have the same genitalia. i decided this because it made writing the sex grammar easier. however, it's also a huge thematic boon. casting marge and maude as transfem makes maude's abjection and their love for eachother much more impactful. it's really easy for me to get chicken-or-the-egg about it. which came first, the High Artistry or the Funny/Fucked Up?
(the real answer, of course, is that it doesn't matter. the text exits anyway and i must shepherd it as it exists, not as i intended it. ego death of the author.)
as for other people's interpretations: i'm quite pleased about the reasoning that anon expressed earlier for why marge was crying while platforming. i was also happy to hear a friend's read that kramer had finally found peace in the meadows, that she's with the girls and relaxing and having snacks. it's not really borne out by the text, but it's such a comforting thought, right? maybe if we imagine kramer happy, she will be.
trivia
the first commit hit my git repo in september 2024, and the simslops released march 2025. all in all it took about six months of on-and-off work.
the name "deviltongue" comes from a character i played in a game of neptune's pride. he ended up getting betrayed and dying badly. so it goes. (on a similar note: as a kid, i thought his name actually was "slideshow bob".)
originally, the sundervalley chapters were going to feature more of the classic cozy small farmer simulator tropes. homer was gonna go fishing and chat up the town's eligible bachelors: crow, tom, and cam. it would've distracted too much from the real core of the chapter, though, so it never got implemented.
my original design for the cover looked like this:
Tumblr media
i'm still not sure i made the right decision switching to the final composition. i like the oddness of eyes on the hair in that version, but the lines over the hair in the this version remind me of one of the ways you see dicks censored in hentai, which feels thematically appropriate.
on that subject, this texture:
Tumblr media
is a heavily mangled collage of a bunch of ai generated images, each of which was created by using the name of a simpsons' character as both prompt and negative prompt. it shows up in the download buttons and (in heavily desaturated form) on the final version of the cover.
the blurbs were slightly modified grammar output. i was pretty fried the day of release & wasn't able to think of anything, so rqd suggested i use a relevant wikipedia extract and use a grammar for the blurbs. i think it turned out pretty well.
there are six secret characters in the simslops. have you found them?
future work
i think i've taken this framework as far as it will go. the system of numerical flags got bent when i stored the farm workers' country of origin as text. the more linear plotted segments required a set of flags trading off each other, which is fiddly to coordinate. generally, everything is very siloed off. the clearest example of this is in the grammars for generating the various bits of procedural text. they're fun to write, and i'm always delighted by the results, but there's a lot of duplication of effort in my current approach. each chapter that uses procedural text has its own grammar with its own set of words and phrases. this is basically fine in this case, but it's not something i want to deal with for future projects. writing grammars is fun, like building a shipyard in a bottle, but it gets mind-numbing after a while. you can only come up with synonyms for laugh so many times, yknow?
my dream is a single massive grammar all output text runs through. since my grammar system can handle conjugating verbs and adding a/an in front of words, integrating all text output with that system would simplify all sorts of things. then i could have big lists of words to query for relevant adjectives or nouns with specific associations, procedural sentence structures, referents that know what adjectives apply to them...
it's really easy to get feature crept in this sphere. we'll see how much of this i'll be able to implement. i don't think all that is necessary to make the simslops framework useful, really. the only thing it urgently needs is some kind of event emitting & handling system. currently all the little special cases have to be implemented specifically. for example, there's a check in the "drop item" action for if the item in question is fragile. if it is, it breaks. if the item is also smoky, we get the "orange smoke pours out" effect. it'd be a lot cleaner (and make me a lot happier) if i could just say "when a smoky object breaks, emit orange smoke" and similar things.
thank you to everyone who read the simslops, and an extra thank you to everyone who asked me questions. now it's time to go back to work on the next issue. it's going to be a very different beast. i hope you enjoy it.
63 notes · View notes
abigailmoment · 11 months ago
Note
A Dream of Silence is one of the most inspiring fan works I’ve ever come across, and now, I’m trying to figure out how to make my own interactive fiction. I’m a writer with a decent programming foundation, so I’ve been doing some of my own research on the best path forward, but I was also wondering what you used to create the game and if you have any advice.
This is the literal best. This is all of my hopes. More people making IF. (claps hands)
I use TWINE! I adore Twine. It is my artistic medium of choice. It's a scripting language for making choose your own adventure games that outputs html files. If you have programming experience I'm sure you could pick it up.
I also use a lot of css and javascript to spruce it up and manage things like the health and energy bars.
30 notes · View notes
mentalisttraceur-software · 5 months ago
Text
DeepSeek R1 First Impressions
DeepSeek R1 is almost as good as me at belabored exhaustive analysis and application of C89 rules. For practical purposes, it's equally good.
I asked: "How would you implement zig-zag encoding in strictly portable C89?" It was spitting out thinking output for at least a minute, but it got a basically-perfect solution on first try:
unsigned int zigzag_encode(int n) { return (((unsigned int)n << 1) ^ ((n < 0) ? -1 : 0); }
It also provided a `zigzag_encode_long`.
Note that this code will optimize on modern C compilers to the best assembly you could write. There is no branch in the produced code with even just `-O1` (`clang`, `gcc`), the branch is how we portably tell the compiler the right idea.
The only thing DeepSeek did "wrong" vs the above, was redundantly add an `(unsigned int)` cast to the `-1`. I mentioned this as I would to a person: that the usual arithmetic conversions would take care of it at the `^`. It reasoned the rest on its own: yes, because the left operand is already at least an unsigned int, so integer promotion will make the left side an unsigned int as well.
We talked at length about how we can prove that the above is portable to the most pathological C89-conformant implementations. It kept taking longer to "think", but it didn't show any weakness until the very last question.
I asked it to help me rigorously prove if the maximum value of unsigned integers is required by the C standard to be a Mersenne number (2^n-1). To have all bits one, that is.
What if an implementation just decided to arbitrarily not use one or more of the top values? I.e., why not `#define UINT_MAX 0xFFFFFFFE`?
DeepSeek R1 didn't seem to conceive of this possibility until I made it explicit. (But it did a great job of ruling out all others.)
Finally, it gave a longer, non-trivial argument, which I don't find convincing. Basically, it seemed to be saying that since integers used "pure binary representation", and every value bit could be either one or zero, well then the maximum value always has all value bits one - in other words, it seemingly assumed that just because each value bit individually was allowed to be one or zero, the possibility of them all being one at once must be both legal and used to represent a distinct value.
I see a shorter argument, which follows directly from what the standard does say: C89 has two definitions of `~`:
flip all the bits;
subtract from maximum value of that unsigned integer type.
The only way both can be true at once is if the maximum value is all value bits one. DeepSeek R1 agreed.
So what does this all mean?
This is an insane level of competence in an extremely niche field. Less than a year ago I tested LLAMA on this, and LLAMA and I didn't even get past me hand-holding it through several portability caveats. DeepSeek R1 and I just had a full-blown conversation that most devs I've talked to couldn't have with me. DeepSeek R1 managed to help me think in an extremely niche area where I'm basically a world-class expert (since the area in question is C89 portability, "world-class expert" is derogatory, but still).
If it's this good in one domain, it's this good in most domains. I bet it can do comparably well in Python, Go, JavaScript, C++, and so on.
In other words, it's already better than many devs in areas like this. I've seen plenty of devs making 6-figure USD salaries who didn't bother to know any of their day job tech stack this deeply. There's a market adjustment coming. Knowledge and expertise are about to become dirt-cheap commodities.
AI will eat current software dev jobs even faster than even I thought - and I already thought it would be sooner than most expect. Meanwhile, much of the industry is busy rationalizing from human intuition and ignorance that it just can't happen.
For years I've thought that the future is human devs delegating to teams of AI. That future is almost upon us, and this AI is good enough that I will be seriously experimenting with making that future a reality. I think if you hack together the right script to hook it up to a sandbox with dev tools, and prompt it just right... you might already be able to get this thing to actually do useful dev work.
8 notes · View notes
cyrsed · 8 months ago
Text
Tumblr media
i made a little javascript fuction the other day to generate random elden ring characters/bosses/npcs for me when i can't decide what to draw, same as i did for necromorphs/dead space characters a while back :B
Tumblr media
i find random character generators to be very useful so if anyone else wants to use the thing i wrote here's how you can run it below the cut
i was running it from my terminal in vscode, but you don't need to do that to get it to run. you can use any number of online javascript/jquery sandbox editors like this one:
https://onecompiler.com/jquery
just go to the "script.js" tab and replace the code in the editor with the code i'll add below, then hit the "run" button and it should replace the text in the output window on the right with a prompt
Tumblr media
code: get random elden ring npc/boss/enemy/creature - Pastebin.com
it's possible there are some typos, i found a few already and fixed em but there may be more i missed idk
8 notes · View notes
deme-real-life · 1 year ago
Text
who is this girl?
as i approach 100 followers and soon become tumblr famous and known across the globe i think it's high time i made an introductory post. hiii ^_^ i'm deme!! or demeter. or dante. or jack. pick your poison from the tetrad
in my free time, when im not staring blankly at whatever assignment ive been tasked with doing (and that i am promptly not doing and that i am instead merely contemplating with growing dread), i like to create! i've been brushing up on my html and javascript in the past year or two, and i made a fully fledged choose-your-own-adventure last year on my birthday! what? you want to see it? erm. no. sorry. the site is scary i need to finish the rest of it you can wait til then
i enjoy long walks on the beach i mean writing and drawing! i'm working on like. three books right now? two are on the backburner. the third one is also on the backburner but i'm trying to reel it in like a bigass fish that is trying to pull me into the ocean depths. i also enjoy drawing from time to time but i would not say i'm particularly good at actually finishing pieces. i'm definitely better at finishing drawings than i am at finishing pieces of writing.
i've combined all three of these interests of coding, writing, and drawing, into my webcomic, finality! you can read it here. as of the time of writing, it's not very long, but i have most of it planned out. as of this september, i'll have been planning it out for a whole three years. scary!
along with she/her, i also use et/cetera! here's the structure for that:
she/her/hers/herself ("She's going to the store in her car to buy some food for herself, but can't find which car is hers.")
et/cetera/ceteras/etself ("Et's going to the store in cetera car to buy some food for etself, but can't find which car is ceteras.")
ADDITIONAL INFORMATION:
I'M TRANSGENDER! GOD BLESS MY NATION 🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️
for fun i like going to https://crouton.net/ and on occasion https://po.ta.to/
i love video games. recently cried several times over outer wilds. i love the fuck out of ultrakill. many other games strike my fancy
i have a SHIT TON OF OCS!!!!!!! i've been developing my oc universe(s) since 2015 so there's like. ok i made a sheet to list them all recently and it's currently coming up on 300 little guys. hell, the characters from finality aren't even on there!!!
i have fixations on transmission towers, houses, and the moon
i run the sideblog @terminal-output, where i post snippets of stories ive written! i have an ongoing narrative forming here
if you are going to reblog shirtless men please tag it as shirtless men. i don't want to see them i'm sorry it's not my thing. honestly despite my womenliker tendencies this also goes for women but i don't think i follow anybody who posts shirtless women
Tumblr media Tumblr media Tumblr media
CREDITS:
Made me // My parents
Creator of et/cetera pronouns // My beautiful brain
Certified Objectkisser Blinkie // by labratboygirl
Prayer to Computer Angel // by netcromancy
This Is Not For You Blinkie // by MEEEEEEEEE it took me an hour and a half. that's what most of the time spent composing this post went towards
Collected The Objectkisser Blinkie And The Computer Angel One And Generally Helped Me Find A Ton Of These // my friend pig who is so cool and follow them forever and give them treats or explode?
20 notes · View notes
cssscriptcom · 3 months ago
Text
Simplify MathML Authoring with Lightweight Syntax - Mathup
If you’ve ever wrestled with MathML, you know it can be… verbose. mathup is a JavaScript library that takes a more developer-friendly approach. It lets you write math using a syntax similar to AsciiMath and outputs MathML. This isn’t about replacing full-blown TeX rendering engines; it’s about making simple, everyday mathematical notation easier to manage in web projects. For example: you write…
2 notes · View notes
rpcburnbook · 3 months ago
Note
html/css are not even considered 'programming' languages. they're markup languages. programming is when you create something that enters in one input and gives you a different algorithmically generated output. markup is you enter in one thing and it spits out the same thing. this is just an example of the pretentiousness in the rpc. 'we're developers' lmao. // And yet, the fun shit everyone wants is usually Javascript - which is programming. Nice Googling, though. // none of what was said required any googling? there's like all of 3 javascript developers and everyone else just shamelessly adds their code into their skins. good try, though.
~
3 notes · View notes
lackhand · 4 months ago
Text
pipe operator in js
Rescuing from my drafts ca march 2023. This is no longer actually true; my company folded last year and I'm back on my gamedev non-sense (bittersweetly!). More details on that soon.
Long time no post. I'm working in elixir these days; I couldn't sleep and so was catching up on modern JavaScript; I watched nerds snipe in the gutters.
what is pipeline?
You read this; you're adjacent to >=1 programmer. It's bash piping, the output from one function goes to the next.
There's a few ways to spell it, from the explicit:
const $0 = foo(input); const $1 = bar($0); const output = baz($1);
Explicit! Legible!
Cumbersome! Weave-y!
To the Hack-style syntax, where the pipe operator creates a variable within its right hand side's scope (sort of like this:
const output = input |> foo($) |> bar($)
Just sugar on top of the above (+ variable lifetime scopes, whatever)
Nobody can agree on the magical "previous expression result" symbol
when the pipe is a series of 1 arg f()s, the ($) extra characters are gross.
To the F#-style syntax, where the calls have to be arity-1 functions:
const output = input \|> foo \|> bar
Handles the happy path 1-arg f() beautifully
requires lambdas or currying and more care for every other case.
F# wins, right?
The community seems to think so.
But it has wrinkles; every method has to be 1-arg, and the hidden closures to enable that have performance impact.
My modest proposal
I wrote this because I didn't want to post on a six-year-and-counting language proposal, but I also had an idle fancy.
To me, the problem isn't a lack of a pipe operator or other functional support.
It's @#_-+&!ing left-hand assignment and community conventions.
You can even see it in the examples, where we have const foo, a bunch of really relevant details, and then wham, we're back to the start for the next line.
What we need is:
A right-hand assignment operator, so that after calculating a variable you can stick it somewhere. Without further thought, I propose =: but I'm sure there could be improvement.
=: assigns to the RHS, and to the special variable it. By default, assigns to _ (discards) -- in addition to it.
A new keyword & local variable "it". "It" is sort of like "this", with special rules about its meaning scoped to the function in which it appears. Typechecking must respect its most recent assignment (how high of a lift is this?!). Lambdas have their own standalone it (so you need to
A community that accepts using non-descriptive variable names & scoped type checkers for this purpose -- for instance, special syntax around right-assigning to $ such that it's type checkable, variable scoped, etc.
The semicolon "operator".
Then a pipe could be written:
input =:; foo(it) =:; bar(it) =: output
Potentially with parens in certain callsites, simplifying it a bit maybe, etc.
Things to improve:
It doesn't look like a pipe.
But is that so bad, when it makes the whole thing so beautifully explicit?
It breaks LHS/RHS naming and conventions (you're assigning?! To the right hand side??!). Doesn't delete foo[bar] do the same? This seems like a very core, very forgivable case to make the code match the language. I do not usually say "x takes the value seven"; I very often do say "store 7 as 'x'".
Real downsides: so many syntax highlighters, code awareness tools etc would need to understand polymorphic horrible "it". Combined with exceptions, the values of it in a catch clause feel pretty scary.
Still, food for thought.
2 notes · View notes
azurepolarbear · 6 months ago
Text
Tumblr media
code art variation - gradient graphs
A gabriel graph is a special category of graph in graph theory where an edge can only be formed between two nodes if the circle formed by those two nodes contains no other nodes in the graph. A random geometric graph is a graph where an edge can only be formed between two nodes if they are less than a certain distance away from each other. 
“Gradient Graphs” is an original generative code art algorithm; each run of the code produces a random visual output. The “Gradient Graphs” program generates random gabriel graphs and random geometric graphs, where each graph has a random number of nodes and each node has a random position and color. Nodes are connected by lines and circles that have a gradient from one point color to the other.
Users can interact with the program to remove the nodes, edge lines, or edge circles, choosing how they would like the graph to be displayed.
“Gradient Graphs” was made with JavaScript and p5.js.
This code and its output are licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0) License.
Copyright (C) 2022-2024 brittni and the polar bear LLC. Some rights reserved.
5 notes · View notes
learnerworld · 5 months ago
Text
What Is a Dynamically Typed Language?
When learning Python, you might hear the term “dynamically typed language” frequently. But what does it mean? Let’s break it down.
Typing refers to type-checking—the process of verifying whether the data types in your code are compatible with the operations being performed.
1️⃣ Strongly vs. Weakly Typed Languages
Strongly-Typed Languages (e.g., Python): These languages don’t allow type-coercion (implicit type conversion). For example:
pythonCopy code"1" + 2  # TypeError: cannot concatenate 'str' and 'int'
Weakly-Typed Languages (e.g., JavaScript): These languages allow type-coercion:
javascriptCopy code"1" + 2  // Outputs: "12"
2️⃣ Static vs. Dynamic Typing
Type-checking can occur at two stages:
Static Typing (e.g., Java, C++): Data types are checked before the program runs. You must declare the type of variables explicitly:
javaCopy codeintx=10; 
Dynamic Typing (e.g., Python): Data types are checked during program execution. Variable types are inferred automatically:
pythonCopy codex = 10  # No need to declare 'x' as an integer.
Python: A Dynamically Typed Language
Since Python is an interpreted language, it executes code line by line. Type-checking happens on the fly, allowing you to write flexible and concise code.
Example: pythonCopy codex = "Hello"x = 10  # No error—Python allows 'x' to change types.
This flexibility makes Python beginner-friendly but also increases the risk of runtime errors if types are misused.
Key Takeaway
Dynamic typing simplifies coding by removing the need for explicit type declarations. However, it also requires careful testing to ensure type-related bugs don’t creep in.
Python learners, embrace dynamic typing—it’s one of the reasons Python is so versatile and fun to use!
2 notes · View notes
andymakesgames · 6 months ago
Text
Andy's 2024 Year in Review
I tend to work on a lot of small projects with a smattering of larger ones mixed in. Often I end the year thinking I didn't do all that much, but then I start going through my posts and realize that I did more than I thought! Hard to believe that stuff I did last January was this year!
I've fallen out of the habit of doing these year-in-review posts, which is a shame, but I'm turning that around right now! Here's a quick look at all the things I made last year.
EMMA
Tumblr media
Probably the biggest thing for me is another successful year of the coop I'm a part of, EMMA Technology Cooperative. After a somewhat tough 2023, we bounced back this year. Seeing us survive a lean time and watching the coffers refill in the past year really drove home the value of organizing around cooperation as opposed to infinite growth. And if you're reading this and in need of a creative technologist, please drop us a line!
Taper - January
Tumblr media
A the start of this year I was on the editorial board of Taper, online literary journal for computational poetry. I only assisted with one issue (which I also contributed to!) but it was a very new experience for me and I'm happy I could be a part of it!
A few years ago I kind of stumbled into the occasional piece of digital poetry without ever realizing. I was doing a literal poetry reading when I realized that I write poems from time to time. It's very fun that my practice occasionally pulls me in unexpected directions.
MAGFest - January
Tumblr media
Every year, we bring all of the games in the Arcade Commons collection to the Music and Games Festival just outside of Washington DC. It is our biggest show of the year by a mile and I love it every time. There is a DIY spirit to MAGFest that really sets it apart from any other con I've been to. We're well underway for 2025 as I write this. As I frequently do, I emceed a bunch of our tournaments.
The Algorithm - February
Tumblr media
What a fun project this was! Alia ElKattan and Lujain Ibrahim contacted me about their Mozilla Foundation-funded project to explain how algorithmic feeds work. I created modular P5JS animations to serve as the "content" for their app.
They found me via the P5 tweetcarts I had been posting during the pandemic. I got to explore some of those same ideas without the super tight character restrictions.
Check it out here.
EMMA Skillshare - March
Tumblr media
I did a small workshop on getting PICO-8 to communicate with Javascript. This was the basis for my project Pico Pond which I wrote about on the EMMA Blog.
This skillshare took those ideas and presented them in a livestream, which you can watch here.
Our Generation - May
Tumblr media
I was contacted by Nick Montfort to submit a piece of computer generated poetry for a small-run book called Our Generation: Programs + Computer-Generated Texts. I channeled my inner Jenny Holzer for this and really enjoyed it. The full src appears at the top of the page and it was interesting to factor that in to make sure the output exactly filled the page. I keep thinking it would be fun to do a series using this size restriction but I haven't done it yet.
You can see my full page here.
Tastebud Tapdancer - May
Tumblr media
You've been swallowed by a giant serpent but you're trying to make the best of it.
A little video game with a source code of just 500 characters! Made for TweetTweetJam 9 You can play it here.
The Indomitable Rocket Dog - June
Tumblr media
Around this point in the year is where I started working on my current project, The Indomitable Rocket Dog. I'm enjoying this game so much. I haven't made a real twitchy arcade game since PARTICLE MACE, which just celebrated its 10th birthday. It is still very early but I feel really good about this one!
After MAGFest 2024 I was percolating on physics-y arcade games mostly because I am so deeply in love with Hoverburger by Nick Santaniello. Before I knew it my love of N++ was mixed in there as well.
I'm writing all of my own physics in C++ because I had a vague sense of how I want it to feel and it's a hobby project so I can do what I want.
I've been documenting my development on it in a mastodon thread.
Isabelle Poppy And Bling - August
Tumblr media
OK, this one isn't new at all! This is a flash game I made in 2009 for musician Justin Braun. But this year I got it playable on the web again!
Like so many game developers my age, I got my start with Macromedia Flash. This game felt like the culmination of my style at the time, which was heavily influenced by Animutation. I was starting to be more deliberate with my collage style as opposed to aiming for totally random elements. I think I got paid $600 for it, which felt huge at the time.
1K Pac-Man - September
Tumblr media
Another size coded game. This time it's as faithful a recreation of Pac-Man as I could muster in 1024 bytes of source code. All of the ghost logic is accurate to the original!
You can play it here. I'm very pleased with the mouth animation.
I made it for PICK-1K Jam 2024. I do wish I had read the page a little more carefully though. The jam required compressed source to be 1024 bytes and I did raw source. The game is only 723 compressed bytes so I had a lot of room to expand, but by the time I realized that I had painstakingly trimmed and optimized my code and I couldn't imagine untangling it. Oops.
Cloud Gobblers - November
Tumblr media
Arcade Commons received a grant from the Brooklyn Arts Council to create an arcade machine showing a collection of games that incorporate weather data into the gameplay. EMMA was commissioned to make one of the games. Cloud Gobblers is a snake-style game where the playfield is a video satellite field of global cloud coverage over a period of 48 hours.
This was the first time all of the members of EMMA worked together on one project!
Three Tapestries - October
Tumblr media
I didn't make many pen plotter drawings this year, but I really liked this one. You can see the full thing here.
It's currently still available in my shop! Until somebody buys it it will be hanging on the wall in my office.
Lever Up Jam - December
Tumblr media
Back in 2021, I worked with Matt Lepage on an alt-control game jam called Jam Jam Revolution. We prepped a parts list so all participants could build the same controller and make games for it. This year we decided to dust off that idea with the Lever Up Jam. This time there will be a full-sized cabinet at MAGFest that the games can be played on!
My favorite TweetCarts / Postcarts This Year
I no longer use Twitter, but I have been making the occasional tweetcart (a PICO-8 sketch with source code 280 bytes or less) and posting them on tumblr and mastodon. But there was an exciting development towards the end of the year! Lexaloffle, the creator of Pico-8 created a section on the BBS for 300 char or less "Postcarts", so we now have a centralized home for these little byte-sized demos.
Here are three of my favorite postcarts that I made this year:
Spinning Cube v3 - April
Tumblr media
p=pset::_::cls()for i=0,99do u=0s=i/4+t()/5x=64+sin(s)*39a=64+sin(s+.25)*39y=39+cos(s)*9b=39+cos(s+.25)*9line(x,y,a,b,6)for k=0,99do if x>a and i<4and k<50then line(x,y+k,a,b+k,k>48and 7or 9+i)p(x,y+k,7)p(a,b+k)end v=pget(i,k)u+=v if(v>6)break if(u>0)p(i,k,8)end end flip()goto _
Big year for making things spin. You can check out my tumblr post to see all my attempts at perfecting this spinning cube. The outlines were the real cherry on top for me.
Balatro Spinning Card - May
Tumblr media
a=abs::_::cls()e=t()for r=0,46do for p=0,1,.025do j=sin(e)*20k=cos(e)*5f=1-p h=a(17-p*34)v=a(23-r)c=1+min(23-v,17-h)%5/3\1*6u=(r-1)/80z=a(p-.2)if(e%1<.5)c=a(r-5)<5and z<u+.03and(r==5or z>u)and 8or 8-sgn(h+v-9)/2 g=r+39pset((64+j)*p+(64-j)*f,(g+k)*p+(g-k)*f,c)end end flip()goto _
This was so hard to make! I can't believe I did it. I wrote a giant writeup breaking down the 279 byte source code on the EMMA blog.
Fuji - October
Tumblr media
pal({7,12,140,13,129,1,5,8,8,14,142,143,7},1)r=rnd::_::x=r(128)y=r(128)c=9+y/26-2+r(1.5) if(y<((x+40)/6)^1.6and y<((178-x)/6)^1.6and y<79+r(2))c=2.5-sgn(y-45-sin(x/21)*r(4))*1.5+r(2.5-sgn(x-69-r(8)-y/3+25)*.7) pset(x,128-y,c)a=r(1)d=r(25)pset(28+sin(a)*d,30+cos(a)*d,9)goto _
I made this during some downtime on a vacation to Japan. I was hoping to see Fuji the next day and the clouds wound up being kind to us, giving an amazing view.
I almost never make representational art and I was really happy with how this turned out.
That's it! I hope you all have a great 2025!
2 notes · View notes
ahad-hossain-blog · 6 months ago
Text
JavaScript
Introduction to JavaScript Basics
JavaScript (JS) is one of the core technologies of the web, alongside HTML and CSS. It is a powerful, lightweight, and versatile scripting language that allows developers to create interactive and dynamic content on web pages. Whether you're a beginner or someone brushing up on their knowledge, understanding the basics of JavaScript is essential for modern web development.
What is JavaScript?
JavaScript is a client-side scripting language, meaning it is primarily executed in the user's web browser without needing a server. It's also used as a server-side language through platforms like Node.js. JavaScript enables developers to implement complex features such as real-time updates, interactive forms, and animations.
Key Features of JavaScript
Interactivity: JavaScript adds life to web pages by enabling interactivity, such as buttons, forms, and animations.
Versatility: It works on almost every platform and is compatible with most modern browsers.
Asynchronous Programming: JavaScript handles tasks like fetching data from servers without reloading a web page.
Extensive Libraries and Frameworks: Frameworks like React, Angular, and Vue make it even more powerful.
JavaScript Basics You Should Know
1. Variables
Variables store data that can be used and manipulated later. In JavaScript, there are three ways to declare variables:
var (old way, avoid using in modern JS)
let (block-scoped variable)
const (constant variable that cannot be reassigned)
Example:
javascript
Copy code
let name = "John"; // can be reassigned const age = 25; // cannot be reassigned
2. Data Types
JavaScript supports several data types:
String: Text data (e.g., "Hello, World!")
Number: Numeric values (e.g., 123, 3.14)
Boolean: True or false values (true, false)
Object: Complex data (e.g., { key: "value" })
Array: List of items (e.g., [1, 2, 3])
Undefined: A variable declared but not assigned a value
Null: Intentional absence of value
Example:
javascript
Copy code
let isLoggedIn = true; // Boolean let items = ["Apple", "Banana", "Cherry"]; // Array
3. Functions
Functions are reusable blocks of code that perform a task.
Example:
javascript
Copy code
function greet(name) { return `Hello, ${name}!`; } console.log(greet("Alice")); // Output: Hello, Alice!
4. Control Structures
JavaScript supports conditions and loops to control program flow:
If-Else Statements:
javascript
Copy code
if (age > 18) { console.log("You are an adult."); } else { console.log("You are a minor."); }
Loops:
javascript
Copy code
for (let i = 0; i < 5; i++) { console.log(i); }
5. DOM Manipulation
JavaScript can interact with and modify the Document Object Model (DOM), which represents the structure of a web page.
Example:
javascript
Copy code
document.getElementById("btn").addEventListener("click", () => { alert("Button clicked!"); });
Visit 1
mysite
Conclusion
JavaScript is an essential skill for web developers. By mastering its basics, you can create dynamic and interactive websites that provide an excellent user experience. As you progress, you can explore advanced concepts like asynchronous programming, object-oriented design, and popular JavaScript frameworks. Keep practicing, and you'll unlock the true power of JavaScript!
2 notes · View notes