We all have our favorite text editor, and are willing to defend its superiority above all other editors by any means necessary. And then there’s Notepad. But what Notepad may lack in text manipulation features, it compensates with its inconspicuous qualities as a gaming platform. Yes, you read that correctly, and [Sheepolution] delivers the proof with a text-based adventure game running within Notepad.
What started out with [Sheepolution] jokingly wondering what such a game may look like, ended up as an actual implementation as answer to it. Behind the scenes, a script written in Lua using the LÖVE framework — for which he also created an extensive tutorial — monitors the state of several text files that make up the game world. Each location is a separate text file to open in Notepad, showing the current state of the game, telling the story with text and ASCII art, and offering choices to the player. The game is played by modifying and saving those text files, which the script then processes to push the gameplay forward by simply updating the content of those files with the new state. Check out the game’s trailer after the break to get a feel of what that looks like.
Unfortunately, Notepad itself doesn’t automatically reload the file when its content changes, so to provide a smoother gaming experience, [Sheepolution] modified the open source implementation Notepad2 to work around this, and bundled it as part of the game’s executable. Initially, he even added animations to the ASCII graphics, but in the end decided against most of them to avoid constant disk writes and race conditions caused by them.
Sure, this is no Game Boy emulator in a text editor, and it may not be as groundbreaking as Notepad’s latest feature, but it’s always amusing to see alternative uses for well-established tools.
Continue reading “Slaying Dragons In Notepad”
If you can’t stand the thought of using an application in your browser, you might as well jump ahead to the comments and start flaming.
Still with us? Imagine this scenario. You are at the office, at a client’s site, at a school, or visiting your mom. Suddenly, for some strange reason, you need to edit a hex file. We don’t know why, but if you are reading Hackaday, it isn’t that big of a stretch to imagine it. What do you do? Download and install a hex editor? Maybe you can’t. Or, if it is mom’s computer, maybe you just don’t want to. Your next option is to navigate to HexEd.it.
Continue reading “Edit Hex In The Browser”
Linux users–including the ones at the Hackaday underground bunker–tend to fall into two groups: those that use vi and those that use emacs. We aren’t going to open that debate up again, but we couldn’t help but notice a new item on GitHub that potentially negates one of the biggest complaints non-vi users have, at least for vim which is the most common variant of vi in use on most modern systems. The vim keybinding makes vim behave like a “normal” editor (and to forestall flames, that’s a quote from the project page).
Normally vi starts out in a command mode that it calls normal mode. Pressing a key will execute an editing command, unlike most other modern editors which just insert characters into the open file. For example, pressing x will delete a character. This surprises most people who aren’t familiar with vi. In all fairness, there are other older editors that work this way, but they usually were not screen-oriented.
Continue reading “VIM Normalization”
We don’t use a GUI IDE, but if we did, it would most certainly be something along the lines of [Martin]’s embedded-IDE project. We’ve always felt that most IDEs are just fancy wrappers around all the tools that we use anyway: Makefiles,
ctags, and an editor. [Martin]’s project makes them less fancy, more transparent, and more customizable, while retaining the functionality. That’s the hacker’s way — putting together proven standard tools that already work.
The code editor he uses is QScintilla, which uses
clang for code completion. The “template” system for new projects? He uses
patch to import and export project templates. Because it uses standard tools all along the way, you can install the entire toolchain with
sudo apt-get install clang diffutils patch ctags make on an Ubuntu-like system. Whatever compiler you want to use is supported, naturally.
We can’t see a debugger interface, so maybe that’s something for the future? Anyway, if you want a minimalistic IDE, or one that exposes the inner workings of what it’s doing rather than hiding them, then give [Martin]’s IDE a try. If you want more bells and whistles that you’re not going to use anyway, and don’t mind a little bloat and obscuration, many of our writers swear by Eclipse, both for Arduino and for ARM platforms. We’ll stick to our butterflies.
We’ve recently noticed two different fonts aimed at programmers, each with a different approach to editor customization. The first, Fira Code, transparently converts common programming digraphs into single characters. For example, <- becomes an arrow and != (or <>) becomes a proper not equal sign. The other font, Hack (can’t argue with the name), aims to make commonly confused characters distinct. For example, the zero glyph has a very distinct appearance from the letter O.
It is pretty easy to understand how Hack works, but Fira seems a mystery at first. Your C++ compiler expects <- not an arrow, right? Fonts support ligatures–sequences of two symbols that run together (like æ). Clever use of these ligatures means that the compiler still sees -> but the screen displays an arrow.
Continue reading “Hack An Editor: Fonts For Programming”
Tired of flashing your embedded project over and over just to tweak a few values? So was [Karl], so he wrote a text editor that runs on his ARM dev board.
Having trouble wrapping your mind around the need for this kind of thing? He’s actually playing around with eLua, the embedded version of the Lua programming language. In this case the program files are being stored on an SD card. But still, moving that back and forth between computer and embedded project gets old quickly. So he invested the time to write a rudimentary text editor that he interfaces through this terminal window. Above you can see the help screen which lays out all of the applications features. Right now it sounds like the only gotcha for this is the amount of RAM it needs to run. As it stands, the editor will now work an mbed board, but it works just fine on an STM Discovery.