Giter VIP home page Giter VIP logo

Comments (5)

coriolinus avatar coriolinus commented on August 20, 2024 1

A domino has two numbers physically etched onto the same stone. This image would correspond to (3, 4):

Individual domino stones are immutable; the same pair of numbers is always present on each stone, though you can of course place the stone in either orientation.

Your proposed solution is not possible with physical domino stones and is disallowed in the test cases.

from rust.

petertseng avatar petertseng commented on August 20, 2024

you cannot make a chain out of this set of dominoes, therefore dominoes::chain(vec![(1, 2), (4, 1), (2, 3)]) returns None instead of Some(chain) where chain is some valid chain

In the context of https://github.com/exercism/xrust/blob/master/exercises/dominoes/tests/dominoes.rs#L24 , Correct simply means that the provided dominoes::chain function returns a chain that:

  • has the same number of dominoes as the input
  • has the same dominoes as the input
  • satisfies the chaining property that for any two adjacent dominoes (a, b), (c, d) that b == c, which also applies for the last domino and the first domino

41 12 23 is not a valid chain for the input (1, 2), (4, 1), (2, 3) because 4 != 3

from rust.

masters3d avatar masters3d commented on August 20, 2024

This was a challenging exercise!
Thanks!

from rust.

asarkar avatar asarkar commented on August 20, 2024

I don't understand why the following aren't valid, i.e. the corresponding tests expect None:
Input: [(1, 1), (2, 2)], Output: [(1, 2), (2, 1)]
Input: [(1, 2), (2, 1), (3, 4), (4, 3)], Output: [(3, 4), (4, 2), (2, 1), (1, 3)]

Every property mentioned in this comment is satisfied.

from rust.

asarkar avatar asarkar commented on August 20, 2024

Got it! In other words, the dominoes in the output [(1, 2), (2, 1)] aren't present in the input. Thanks.

from rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.