Slaying Dragons In Notepad

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”

Edit Hex In The Browser

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.

The application, by [Jens Duttke], uses HTML5 and JavaScript and is actually a nicely capable editor. It shows the data in hex and ASCII as you’d expect. It also shows the current cursor location in a number of formats like 8-bit integer, 32-bit integer, date and time, and more. It even shows all the representations as big endian and little endian.

Continue reading “Edit Hex In The Browser”

VIM Normalization

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”

A Real Hacker’s IDE

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, diff, git, 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 diff and 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.

Hack An Editor: Fonts For Programming

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”

Text Editor Running On Your ARM Project

bare-metal-elua-text-editor

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.

Javascript Vi


Few would dispute that Vi was a great text editor in its day, but no one has done anything to bring it back until now. A company called Internet Connection has developed JSVI, a clone of Vi that was written in javascript and runs inside editable text areas on virtually any browser with javascript support.

It functions identically to Vi, offering ed/ex command support, vi-keys, unicode awareness, and a number of other features available on Vi. You can see a demo of JSVI here. If you prefer to run vi on your own page, download this javascript document. JSVI is open source, and we certainly agree with [Jason Striegel] that this would make a fitting addition to any Unix blog or forum.

emacs sucks.

[via Hackzine]