Author Topic: Yet Another Brainf*ck Text Editor  (Read 12205 times)

0 Members and 1 Guest are viewing this topic.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Yet Another Brainf*ck Text Editor
« on: August 22, 2011, 08:55:48 pm »
Introducing the future of text editors, the Tidal editor. Hand-written in raw, optimized Brainf*ck (after being ported from both the TI-84+ and Casio FX-CG families of calculators) and released under a GPL license for this exclusive beta download, Tidal is the fastest and most powerful Brainf*ck text editor around.

Spoiler For Screenshots:

Spoiler For Usage:
Tidal is a standard text editor designed to work with the Brainf*ck Developer. Normal usage is very simple: Just type in the text you want to edit on the input line. Backspace is used by entering the "~" character as input. Also, please comment about features you'd like to see added to Tidal, such as a native brainf*ck interpreter or dynamic refresh.

Spoiler For Source:
Quote
+[-,>,----------[++++++++++>][-][<]<[>+>+<<-]+>-[<+>-]>>>>+++++++[
<+++++++++>-]<[<++>-]<<[>-<-]>[>>]<<[-]<[-]<+]

« Last Edit: August 22, 2011, 10:43:01 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: An epic Brainf*ck text editor
« Reply #1 on: August 22, 2011, 09:01:16 pm »
its really that small?  :o
« Last Edit: August 22, 2011, 09:01:24 pm by yunhua98 »

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: An epic Brainf*ck text editor
« Reply #2 on: August 22, 2011, 09:02:20 pm »
The text editor core is like five instructions :P

The rest of that is just parsing inputs.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline NecroBumpist

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 130
  • Rating: +14/-5
  • Master of Lua
    • View Profile
Re: An epic Brainf*ck text editor
« Reply #3 on: August 22, 2011, 10:20:43 pm »
I love brainf*ck! I also love ><> :)
Developing Lua scripts for the NSpire ?
Check out the Necrotorium
Need a few routines to run faster ? Checkout the MODS Lua Assembly Toolkit.
Need to save space for your scripts ? Checkout LuaSrcDiet

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Yet Another Brainf*ck Text Editor
« Reply #4 on: August 23, 2011, 12:19:09 am »
Way to go Qwerty, it works great. I typed it into my on-calc BrainF*ck compiler and it worked great. The only problem was that I had no way to type ~, and I feel like half the code is devoted to backspacing...


its really that small?  :o

It's actually pretty long if you type it out. It took 8 full lines in the basic editor.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Yet Another Brainf*ck Text Editor
« Reply #5 on: August 23, 2011, 12:25:42 am »
Yeah, the equality test I used for ~ is... slightly long. But if you want to replace "~" with your own value, just change this part of the code to generate the character value you want:
Code: [Select]
+++ ++++[<+++ +++ +++>-]<[<++>-] That's set to 0x7E or 126 in the regular code. The test works for any value.

On a side note, I still have features planned for this simply to see if I can implement them :D
« Last Edit: August 23, 2011, 12:26:22 am by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Yet Another Brainf*ck Text Editor
« Reply #6 on: August 23, 2011, 12:54:46 am »
I made it use 'z' = 0x7A by simply adding -- right before the final [<++>-]. But then nothing changed.

So I debugged the whole thing and I saw the magic in action. It was so cool to see the whole thing work out perfectly and end with 00's. But what I saw is that it doesn't actually update the screen, it just deletes the memory. So now I know.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Yet Another Brainf*ck Text Editor
« Reply #7 on: August 23, 2011, 12:56:46 am »
There are a few interpreter oddities that make refreshing the screen a PITA to do consistently, so that's one of the things I want to figure out next.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline JustCause

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 810
  • Rating: +115/-5
    • View Profile
Re: Yet Another Brainf*ck Text Editor
« Reply #8 on: August 23, 2011, 03:53:24 pm »
This is incredible. HOW DO YOU DO THIS.
« Last Edit: August 23, 2011, 03:53:36 pm by JustCause »
See you, space cowboy...

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Yet Another Brainf*ck Text Editor
« Reply #9 on: September 28, 2011, 12:37:07 pm »
I went back and commented the source for anyone who's curious about how the magic happens. There might be a few minor errors because I lost the original (commented) source to this, so I had to figure out what was going on again.

Code: [Select]
+[-,> // notice the similarities of this code to the main interpreter loop code of "+[-,>+]"
     , // handle the \n most editors insert after input where the character code for \n is 0x10
 ----------[++++++++++>] // subtract 0x10 from second cell. If still non-zero (for multi-character input),
  // restore it and switch to next cll
  [-] // zero the value of the cell to operate on (to handle bad interpreter memory initialization)
  [<]< // go backwards to the last character entered
  [>+>+<<-]+>-[<+>-] // copy character entered out to next two cells
  >>>>+++++++[<+++++++++>-]<[<++>-]<< // the character code for "~" is 0x7E which can be factored as 7*9*2
  [>-<-]> // subtract the character code from 126
  [>>]<< // if 0, move pointer back to value of character in memory
  // otherwise nothing happens
  [-]< // erase value of cell containing previous character code (if current code is 0x7E)
  [-]<+ // clean up memory normally

 ]
« Last Edit: September 28, 2011, 12:37:50 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: Yet Another Brainf*ck Text Editor
« Reply #10 on: September 28, 2011, 01:37:39 pm »
what's Brainf*ck?
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Ashbad

  • Guest
Re: Yet Another Brainf*ck Text Editor
« Reply #11 on: September 28, 2011, 04:55:19 pm »
This is incredible. HOW DO YOU DO THIS.

You type the code and it does stuff.  In cases like this, sometimes cool stuff.

what's Brainf*ck?

The classic Esoteric Language (basically, a language that exists either as a joke or to challenge programmers), that has a tendency to F*ck your Brain.  Hence, the fitting name :)