- Can over proofed dough be harmful to breathe in?
- Is it safe to eat expired hollandaise sauce mix
- MEAN stack app robots.txt not performing as expected
- Robots.txt with only Disallow and Allow directives is not preventing crawling of disallowed resources
- .httaccess password protection not working on recently updated browsers
- notmuch with multiple IMAP accounts and Maildir folders
- Can email senders figure out my catch-all email address by looking at the email headers?
- Array Formula Auto-Calculation in Google Forms
- Google Script to set the current month once a day only in a cell
- Search prices for a list of items
- Can there be a feature that redirects an off-topic question to the appropriate StackExchange site?
- How to enter a code between two list items? [duplicate]
- Code sample in a list has no padding [duplicate]
- Show the cast close-vote reasons
- Hosting a Remote Node
- JSON-RPC Not Working as Shown in Wallet Guide
- Altcoins to Monero payment buttons for website?
- Problem of deploying contract with “testRPC” and “remix” : “creation of contract pending …”
- Best Method to Increase TPS on PoA Blockchain
Failed job application test: program which alters 2d list based on commands
I recently was given this question for an interview application and am wondering where I went wrong. (The whole answer is contained in a skeleton which they gave me and includes unit tests which I haven't included here so it's possible I failed due to a mistake outside the file posted here.)
The program is run by:
bitmap_reader = BitmapEditorFileReader()
The program should read a file containing string commands, and edit a 2D list based on these commands. The question is framed as a bitmap editor, i.e. the 2D list represents a bitmap image, with each element being a letter which represents a colour. The commands are as follows:
I N M - Create a new M x N image with all pixels coloured white (O).
C - Clears the table, setting all pixels to white (O).
L X Y C - Colours the pixel (X,Y) with colour C.
V X Y1 Y2 C - Draw a vertical segment of colour C in column X between
rows Y1 and Y2 (inclusive).
H X1 X2 Y C - Draw a horizont