Share your repls and programming experiences

← Back to all posts
A Text Editor in the C++ Console
RomeroSchwarz (269)

I've been learning c++ recently, and decided to take on a text editor. Using the input method that I explained here, I made a pretty rudimentary text editor. It's pretty easy to use, just open a file to read or edit and type away. Press shift + ~ to save and ` to exit. There is already one file included, it's called "test.txt" and contains the word "text".

Commentshotnewtop
CSharpIsGud (643)

https://repl.it/@CSharpIsGud/cpp-text-editor Here is a revised version of this, it handles input and rendering better.
For example when typing into the editor the terminal does not flicker.

sycrepl (10)

Also i really like how you can just type c [name] rather than c then name in another input. Can't tell if that was intended

Andi_Chin (220)

@sycrepl doesn't look like it was intended

MCRusher (2)

@sycrepl you can also type any letter that isn't r and then [name]

because they put

choice == 101 or 99

instead of

choice == 101 or choice == 99

[deleted]

Good job here, I've always been interested in C++, but never got into it.

sycrepl (10)

Slight problem, read only mode doesn't make new lines :/

RomeroSchwarz (269)

@sycrepl fixed it, thanks for telling me

Giothecoder (132)

Why do you or 101 by 99 in your compare on line 81

sugarfi (587)

@RomeroSchwarz instead of using the ASCII codes, in C/C++ you can simply type the char literal ('a', 'B', etc.) to get an ASCII code. 'A' == 65, for example.

CSharpIsGud (643)

@RomeroSchwarz in C and C++ char is essentially equivalent to a byte, a lot of projects use them as bytes more than they do as characters

Andi_Chin (220)

really good I like it. you should add vim commands too!