applyboard / coop-fall-2020-challenge Goto Github PK
View Code? Open in Web Editor NEWCoop Hiring Challenge for Fall 2020
Coop Hiring Challenge for Fall 2020
Hey there,
If the number specified for bulk redo exceeds the number of undos performed, what should the expected output be?
Kind Regards,
Adi
@omasabdullah here is my code
In the python tests we have:
def test_redo():
sourcer = EventSourcer()
sourcer.add(5)
sourcer.add(5)
sourcer.add(5)
sourcer.undo()
sourcer.undo()
sourcer.add(1)
sourcer.redo()
assert sourcer.value == 11
Seems like the order goes 0 -> 5 -> 10 -> 15 -> 10 -> 5 -> 6 -> nothing to redo since we added 1 which removed the future. Am I understanding the problem incorrectly?
Does not test simple undo redo as explained in video. https://youtu.be/X6NJkWbM1xk?t=219
Once stepped back in time should not be able to redo.
Test fails when it assumes redo should result in output of 11, but instead gets 6.
0 -> (add 5) 5 -> (add 5) 10 -> (add 5) 15 -> (undo) 10 -> (undo) 5 -> (add 1) 6 *future erased, no redo
Hi, assuming we do
bulk_undo(6)
then we do
redo()
does this redo all of the 6 undos we just did, or does it only undo the last 1 out of the 6?
Maybe this was already asked. Sorry if it was.
Thanks in advance
here is my pull request
https://github.com/ApplyBoard/coop-fall-2020-challenge/pull/70/checks?check_run_id=859090727
Two things - There seems to be an extra test redo
that is just a duplicate of 'test undo'
test('test redo', () => {
let sourcer = new EventSourcer();
sourcer.add(2);
sourcer.add(2);
sourcer.add(2);
sourcer.add(2);
sourcer.undo();
expect(sourcer.value).toEqual(6);
});
And the actual issue is the real test redo
which has an incorrect output value as far as I can tell
test('test redo', () => {
let sourcer = new EventSourcer();
sourcer.add(5);
sourcer.add(5);
sourcer.add(5);
sourcer.undo();
sourcer.undo();
sourcer.add(1);
sourcer.redo();
expect(sourcer.value).toEqual(11);
});
You add to 15, undo to 5, then add 1 to get to 6. The expected output seems to redo the undone 5, but the addition of 1 should be clearing the redo list, making the final output 6.
Hey,
Would like to add labels for Student & Co-op for my PR but it seems I don't have permission.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.