CS-521: Homework - One Continuous String - Python - Computer Science Assignment Help

Download Solution Order New Solution
Assignment Task:

In this assignment you will compare two implementations of storing text files:

  1. One continuous string (newline char as separator).
  2. List of strings where each string represents a line

Each of these representations has to be implemented as a separate set of functions and, of course, with separate Python file For each implementation, you will write editor functions to move the “cursor”. In each representation, you use a cursor to represent the current position. For example, for (1) the cursor is just the position (index). For (2), the cursor is a pair: the index of the line and the position within the corresponding line string. Finally, for (3) the cursor is a pointer to the node (containing the line) and the position within that line.
Write (and test) the following 10 functions (names are taken from old vi editor) for each implementation

  1. cmd_h:  move cursor one character to the left 
  2. cmd_I:   move cursor one character to the right
  3. cmd_j: move cursor vertically up one line 
  4. cmd_k: move cursor vertically down one line
  5. cmd_X: delete the character to the left of the cursor
  6. cmd_D: remove on current line from cursor to the end
  7. cmd_dd: delete current line and move cursor to the beginning of next line
  8. cmd_ddp: transpose two adjacent lines
  9. cmd_n:   search for next occurrence of a string (assume that string to be searched is fully in one line.
  10. cmd_wq: write your representation as text file and save it

Think of and implement any other 5 functions (your choice)

For testing, you will read the following “nerdy” poem (from the “Zen of Python”) into your “file representation”. 

This Computer Science Assignment has been solved by our Computer Science Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.