kokobillsoft / BuildingMaket

0 stars 0 forks source link

Pen & Paper #7

Open AlexisK opened 6 years ago

AlexisK commented 6 years ago

Implement class Pen and class Paper - a Pen is created with an amount of ink. It can write on the Paper. Handle not enough ink problem. Paper should know what is written on it. Paper should have a method .print() that prints it content.

AlexisK commented 6 years ago

https://github.com/kokobillsoft/BuildingMaket/blob/master/AlexisLessons/SecondHomeWork/PenAndPaper.js

AlexisK commented 6 years ago

Make it work with the following example:

    var pen1 = new Pen ();
    var paper1 = new Paper ();

    pen1.write(paper1, 'Hi.\n');
    pen1.write(paper1, 'I think, inks are running low.\n');
    pen1.write(paper1, 'This should never be written!\n');

    console.log(paper1.print());