Comments (4)
wouldn't it be OK if we were using two domino sets though? see no reason why the dominoes would have to be unique
from rust.
I am just trying to understand the rules of this "game". I have not really played this kind of loop "chain" dominos. I'd like to add more test cases to a Swift version I am working on. My first impression is that all stones in a chain should be unique because most games with dominos are played using one one set of unique dominos. Otherwise we can have test cases like (1,1), (1,1), (1,1), (1,1), (1,1), that would be valid but don't really make sense. Plus I'd like to expand my version to check to see if a stone can be inserted into a valid chain or if a stone can be removed and still have a valid chain etc.
from rust.
Well, let's explain why those tests cases are there in the first place, they stop some incorrect solutions from falsely declaring a chain is possible when it isn't.
Consider the [(1, 2), (2, 1), (3, 4), (4, 3)]
test case. Some solutions will falsely declare that a chain can be made of [(1, 2), (2, 1)]
when this is incorrect because it hasn't used all the dominoes. Sure, it could be changed to [(1, 2), (2, 3), (1, 3), (4, 5), (5, 6), (4, 6)]
, but that seems unnecessary.
Similarly, [(1, 2), (2, 3), (3, 1), (2, 4), (2, 4)]
is there to stop some solutions from falsely declaring that (1, 2), (2, 3), (3, 1)
is a valid chain when it's clearly invalid because it hasn't used all the dominoes. Sure, it could be changed into [(1, 2), (2, 3), (3, 1), (2, 4), (4, 5), (5, 2)]
but it also seems unnecessary.
Why did I say in both cases that something seems unnecessary? Becuase it over-complicates the test cases to expose simple problems. I think it should be a principle to find the simplest test case that exposes a problem.
I have no opinions about [(1, 2), (5, 3), (3, 1), (1, 2), (2, 4), (1, 6), (2, 3), (3, 4), (5, 6)]
though. That was here long before my time.
Plus I'd like to expand my version to check to see if a stone can be inserted into a valid chain or if a stone can be removed and still have a valid chain etc.
You may find that those checks devolve into "is that domino of the form (x, x)?"
If the checks can affect multiple dominoes, then the checks become "are the dominoes themselves a valid chain?"
from rust.
I see, is more about making it a little more challenging.
from rust.
Related Issues (20)
- Question/Possible documentation issue: How to enable features? HOT 2
- Remove test_ prefix from test functions HOT 1
- Test in CI that we're in sync with problem-specifications HOT 2
- Simply linked list test error HOT 1
- Pin test runner to a specific version HOT 1
- Document / reconsider `topics` field in track config HOT 1
- Improve example solution testing scripts
- CamelCase test unintentionally removed from acronym exercise HOT 2
- Building a training set of tags for rust HOT 25
- Tests fail with no output HOT 15
- Tests don't pass when sending Cargo.toml with optional dependency HOT 1
- Remove all util functions from test files HOT 4
- Test in CI that stubs don't generate clippy warnings HOT 1
- Move more CI tests to rust tooling
- Concepts for this track are not displayed HOT 1
- word-count: change interface from u32 to usize
- test type_override fails even when correct solution is made in macros lesson HOT 1
- Performance issue about the Isogram problem approach HOT 1
- Add test that templates match generated test suite HOT 5
- One of two-bucket's test case is wrong HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.