Git Product home page Git Product logo

nema-oss / edu Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 89 KB

edU (ed with multiple undos) is a simple command line text editor, which allows to manipulate sequences of strings by insertion and deletion. Moreover, it allows to undo actions and re do them. This work has been assigned as a project in the course Algoritmi e Principi dell'Informatica at Politecnico di Milano, A.Y. 2019/2020.

C 100.00%

edu's Introduction

edU

edU (ed with multiple undos) is a simple command line text editor, which allows to manipulate sequences of strings by insertion and deletion. Moreover, it allows to undo actions and re do them. This work has been assigned as a project in the course Algoritmi e Principi dell'Informatica at Politecnico di Milano, A.Y. 2019/2020.

The text is divided into lines. The editor will accept 5 types of commands:

  • change - (ind1,ind2)c: this prepares for the insertion of text on lines from ind1 to ind2-ind1+1. The text that follows must be composed of a number of lines equal to ind2-ind1+1 and ind1 has to be either an existing line number or the line after the last line of text (or 1 if there is no text).

  • delete - (ind1,ind2)d: deletes the text in between indices ind1 and ind2, extremes included. The deletion of a line that doesn't exist has no effect.

  • print - (ind1,ind2)p: prints the lines from ind1 to ind2 included. When a line doesn't exist, "." is printed, followed by a newline.

  • undo - (n)u: undoes the last n deletions or changes. n includes also actions that have no effect, such as the deletion of non existing lines.

  • redo - (n)r: redoes the last n actions that have been undone by a previous undo command.

The editor assumes well formed commands, where ind1 is always either an existing line number or the first empty line after the last line of text. Moreover it assumes no commands with ind1>ind2 or ind1<1 are issued.

edu's People

Contributors

nema-oss 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.