Can this be solved in Rust

Hello.

I found this challenge on a site where I have learned c#. But now I wonder if this can be done in Rust
https://github.com/csinn/CSharp-From-Zero-To-Hero/tree/Chapter2/extra-challenge/milkshakes-sim

and if so, how can I take care that the max of static robots is used.

Roelof

Rust and C# are both Turing-complete programming languages, so, at least for fully computation-based problems like this one, any problem that can be solved with one language can be solved with the other.

As for this particular problem, the specification seems to have a number of weaknesses and ambiguities. (Are there really two kinds of drinks, or just one? Which robots can take orders? Can the MK1 robots make drinks or not?)

As for how to ensure that the stationary robots are kept busy, your best starting point is to think in abstract terms. If you were one of the mobile robots, what would you do to keep the stationary robots busy? If you can develop a strategy in plain human language, that gives you a specification that can be translated into basically any programming language, Rust included.

Yep. I know . I tried this in c# but im get very stuck. I ask the person who has made this one and he said we can do what we like as long as we solved this one.

I was thinking this way but that was not leading to a answer.
Lets suppose we have a static robot which can make a drink at that cost 2 min.
now we also have 10 customers at a time and they all want a drink within let's sat 5 min.
But then I do no see how to proceed.
This is one of the reason I quit this course because we get a lot of challenges where info was missing.

The question sounds pretty open ended and seems to let you make assumptions.
the question says motor and shaker so those are probably traits, maybe try making mk1, mk2, mk3 structs that implement these traits, then put them in 3 queues?
then if you need a cocktail see if there's a robot available in the mk1 queue, if one is use it, otherwise go for a mk3
similar for when you need to serve, try mk2 ortherwise mk3.

put the customers in a queue too.

just some random ideas I came up with.

hmm, I understand what you are telling I think.
That could be working because I use then only the robots I need and as soon as they ready I could put them in a queue back.

Time to experiment

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.