GithubHelp home page GithubHelp logo

progetto-api-2020's Introduction

ProgettoAPI2020

Description of the project can be found here.

Specific document can be found here.

edU, or ed multiplies Undo

This project has been developed as part of the "Algoritmi e Principi dell'Informatica" course at Politecnico di Milano. It has been evaluated "30/30L".

A C program that represents a text editor, where you can add, remove, print lines and do undo or redo actions.

Input Format

The program expects its input from stdio with the following format.

NOTE: MAX length of a line: 1024. Commands are considered correct.

Addition of lines

To add a line to the editor, it is needed to write the lines after the ind1,ind2c instruction, and after the last line, write a '.'.

Example:

1,2c
First Line
Second Line
.

Deletion of a line

To delete lines, it is needed to use the following format: ind1,ind2d NOTE: if you try to delete lines that doesn't exists, the command will have no effect.

Printing lines

To print a group of lines, it is needed to use the following format:

ind1,ind2p

NOTE: if the line doesn't exists, it will print a '.'.

Undo action

In order to go back to a previous version, you can do the following command ind1u where ind1 is the number of version that you want to go back.

Redo Action

Like undo, the command to do a redo is the following one: ind1r

Example of the input stream:

1,2c
first line
second line
.
2,3c
new second line
terza riga
.
1,3p
1,1c
new first line.
1,2p
2,2d
4,5p
1,3p
4,5d
1,4p
3u
1,6p
1r
1,3p
q

Example of the output stream:

first line
new second line
third line
new first line
new second line
.
.
new first line
third line
.
new first line
third line
.
.
first line
new second line
third line
.
.
.
new first line
new second line
third line

Testing Result

progetto-api-2020's People

Contributors

pablogiaccaglia 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.