6 kyu
Coffee machine
169marko-bekhta
Loading description...
Puzzles
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
I suggest you add the "Object-oriented Programming" tag.
Typo in the description: "he would also like to now" should be "he would also like to know"
Fixed.
to @author Thanks for this Kata. It is good to train/check the understanding the features of the language. Me personnaly, I have bunch of various more difficult (from algorithmistic pov) katas solved in my portfolio, but with this kata I've struggled for a long time and finaly it's done)) And as I expected the soultion - of course - is very simple
:) glad you liked it!
Upgraded Java translation to work with Java 17
codewars.coffee.PreloadedCoffee$CoffeeMachine referenced from a method is not visible from class loader
)java.util.Map
in solution setupApproved.
Initial solution is missing an import for
Map
.Fixed.
I'me genuinely grateful for this experience. The best Kata so far
:) glad You've Liked it !
A little typo in the description: "which produces
[S]coffees:"Fixed.
This Kata was great. I had some difficulties to find out, what I have to do with .makeCoffee(). Only the bad thing is that Codewars say I forfeited, so I didn't get my points ...
Nice idea for Kata. Different.
Couple minor typos in the description: Your company decided to by a CoffeMachine from a CoffeMachineFactory.
thanks! updated the description.
This comment has been hidden.
:) fixed, thanks!
This comment has been hidden.
yep, that's the idea that the
Coffee
andCoffeeMachine
is sort of closed. But it's solvable :)Could you provide some indications about the way to do it? I really don't see it. :o
hmmm.... Well important thing here is that
CoffeeMachine
is an interface (not abstract class or class or enum... but an interface) and the solution is based on a language feature (if we can call it so). It's kind of that thing - if you know about it, the solution is very easy.Also see how the coffee machine is created in the separate method? Maybe you can do something with that returned object in that method ? to somehow add more functionallity to it ?
if this is not very helpfull either let me know :)
This comment has been hidden.
just a quick update for you - it's my fault (I'll update the initial Kata in a few) but to make your code compile for now just add in the import section: import static codewars.coffee.PreloadedCoffee.*;
sorry for the confusion that this caused you.
I did put it in different files and different classes but CodeWars allows to add just one file with preloaded things so I put all of the helper classes as inner classes/interfaces, but didn't update the initial solution ....
This comment has been hidden.
HA!! GOT IT! \o/
Will your modifications invalidate my solution?
EDIT: Seeing your solution, it seems I found a work around... ;o
This comment has been hidden.
This comment has been hidden.