Giter Club home page Giter Club logo

edu-command-line-text-editor-w-multiple-un-redo's Introduction

๐Ÿ”ƒedU GitHub commit activity GitHub last commit GitHub code size GitHub repo size GitHub file count GitHub follow GitHub fork GitHub watchers GitHub star

EdU (editor with Undo) is an highly efficient text editor (in time (ms) and space (RAM usage)), with a multiple undo/redo feature. The program utilizes the command line interface and works with textual input commands. This project was made as an assignment for Algorithms and Data Structures (2019-2020).

Author

Demo

GIF demo

Installation

Download the repository and extract everything into a folder. The code has already been compiled as "runnable.exe", which can be run directly by double clicking it on any machine with a Windows OS. Otherwise, to compile and run the "code.c" file, type the following commands into a terminal or command prompt opened in the folder where you extracted the zip's content:

  gcc code.c -o runnable
  ./runnable

You can now use the text editor โŒจ๏ธ.

How to use

The program accepts the following inputs:

  • (ind1, ind2)c: changes the text present on the lines between ind1 and ind2 (extremes included). The text following the command must be a number of lines equal to ind2-ind1 + 1. ind1 must actually be either an address present in the text, or the first address after the last line present in the text (or 1 if the text is still empty).
  • (ind1, ind2)d: deletes the lines between ind1 and ind2 (extremes included), by moving upwards the lines following that of address ind2 (if there are any). Deleting a line that does not exist in the text has no effect.
  • (ind1, ind2)p: prints the lines between ind1 and ind2 (or between ind1 and the end of the text if ind2 does not match any address in the text). For each non-existing row between ind1 and ind2 (included) the editor prints a line containing only the dot character.
  • (number)u: undo a number of commands (c or d) equal to the one specified in parentheses (an integer strictly greater than zero). A sequence of consecutive undo commands cancels a number of steps equal to the sum of the steps specified in each of them. If the number of commands to be canceled is higher than that of the commands executed, all steps are canceled. The execution of a text modification command (c, d) after an undo cancels the effects of the permanently canceled commands. Note that in the number of commands to cancel the no-effects commands (for example deleting a block of lines that do not exist) are also counted.
  • (number) r: cancels the effect of undo for a number of commands equal to the starting number from the current version. The number must be an integer strictly greater than zero. We therefore have that a sequence of commands like 10u 5r is equivalent to the 5u command only. Similarly, the sequence 12u 3r 2u 7r is equivalent to the 4u command. If the number of commands to be redo is greater than those currently canceled, it is performed the maximum number of redos possible.
  • q: finishes the execution of the editor.

Example

carbon (1)

๐Ÿ›  Skills

Basics of C ad standard libraries. Optimization of RAM usage and execution time with highly efficient data structures.

๐Ÿ”— Links

portfolio linkedin

edu-command-line-text-editor-w-multiple-un-redo's People

Contributors

eliafantini avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.