The driver prints one page #7. Make it print it three times.
- Copy the line with the command
keks.print(page)in the end of the program.
- And once again.
- Replace the value of the
You proved that you can create programs with complex logic. And the Muffin entrusts you with a big and serious project: development of drivers for the new printer of MuffinRoks ® brand. A driver is a special program that allows a computer to control technology (mouse, keyboard, printers, scanners, monitors and other devices).
The new printer is simple enough, it should be able to print all the pages in direct and reverse order, print even and odd pages and make copies of one page. And your driver program should make this happen.
However, the test printer has not yet been sent to us (the development is taking a long time, after all, the Muffin’s engineers sleep 20 hours a day). Therefore, the logic of the drivers will be worked out with the help of a special command
keks.print, which takes into account an input page number. Here is an example:
// Logs in the console the “Print page #1” line keks.print(1);
Now this command just logs the text in the console. But as soon as the test sample is sent, it can easily be reconfigured to work with a printer.
Let’s start with a simple task: you need to get the printer to print the specified page several times.