8 kyu
Grasshopper - Terminal Game #1
5,794 of 10,664danleavitt0
Loading description...
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.
UPDATED GROOVY TRANSLATION
Changes:
org.junit.jupiter.api.*
instead ofassert
for testingorg.junit.jupiter.api.Order
is implemented correctlyJava Translation How has there been no Java translation yet?
Has been merged by someone (maybe Madjosz)
Groovy Translation
Thanks for the Kata!)
Please, can one of the contributors add the tag
OBJECT-ORIENTED PROGRAMMING
, as the task includes OOP functionality?)Translated to PHP
Wasted 3 hours to do this kata, and i had to learn OOP.
This comment has been deleted.
This comment has been hidden.
OOP == 8 kye? Really?
Syntax for classes more than actual OOP. So I would agree that 8kyu is not that far-fetched.
( JS )
Class is not tested to return instances of itself. It might return plain
Object
s. This is not explicitly specified, but it can't be intended.I'm with most of the comments on this one. I had no idea what the point of this was and when I clicked "test" it failed every time, but when I clicked "submit" I had what I needed and I passed. Needs a better description or at least an explanation that you don't need to "test" anything in order to be able to "submit" it.
Example tests were added for JS
This comment has been hidden.
Because these should be attributes of
Hero
and not methods.Thank you!
Yeah ok solvable but this kata has no clear formulation, and no test cases. This is IMO below the minimum for an acceptable kata. Or at least not at 8kyu, would cause only frustration for many if an early kata.
I added sample test cases for JavaScript.
What are we supposed to do?
For Python , kata is not clear. No explanation for what to do
The description is clear (it is the same for every language) and explains what must be done. If you don't understand it, you need to learn and document yourself. Make a online research with the correct keywords (class and attribute).
It can be more precise as other katas on codewars. It can explain, what it expects in outputs.
No sample tests in JS.
There is already an issue raised about that (by ejini, 11 months ago), no use to raise more.
No Sample tests in JS.
See just above.
Another good Python OOP Kata, thank you.
I think it is not necessary to prove that the task is simple, but: Traceback (most recent call last): File "main.py", line 2, in import codewars_test as test ModuleNotFoundError: No module named 'codewars_test'
please fix it)
Click reset, try again.
Yes! now it works thanks! The funny thing is that I thought to press reset myself, but I didn't do it for something I wrote here... it 's even a shame ) conclusion - you should not rush haha
I don't understand what am I supposed to do, a class?
This comment has been hidden.
OP solved it, closing
No sample tests in JS
Node 12 should be enabled (Refer this and this for more info)
Fixed.
This comment has been hidden.
I don't get it? I got a error!!!!:
Traceback (most recent call last): File "main.py", line 15, in newHero = Hero(name) TypeError: init() takes 1 positional argument but 2 were given
__init__
should take 2 parameters, not one.I added name but i got an error again!!!
Traceback (most recent call last): File "main.py", line 3, in myHero = Hero() TypeError: init() missing 1 required positional argument: 'name'
Because
name
is an optional argument.This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Can anyone offer some help/suggestions, I passed 5 tests but fail 1 getting the message Expected: Hero, instead got: undefined.
I'm not sure what I'm doing wrong here. Any help appreciated.
This comment has been hidden.
looks like u solved it
For me, the instructions saying the name could handle input when it couldn't made me fail the first few times. Maybe I was missing something. Had to set the name to something, would not handle test cases.
This comment has been hidden.
This comment has been hidden.
Like this sequence :) Ruby translation kumited
I get the following error:
'Hero' should equal 'Greg'
and "should use the name argument" info. How can I solve it? Any suggestions?Take a look at this and see if it helps. If not feel free to follow up with me.
I use Python...;)
Have you figured out your problem? Because your solution works.
Yes. I have solved it. Thanks.
This comment has been hidden.
Sorry for the delayed response. Take a look at this and see if it helps. If not feel free to follow up with me.
I think the problem isn't clearly worded. Could you possibly clarify it? Others seem to have expressed similar concerns.
Thanks!
To echo ccrisis' suggestion, I feel like there could be a better description. I had the "correct" solution for days, but due to the final solution test cases not being clear, I had to sit on it. I'm new to programming in general, so more information would be super helpful to folks like me.
So i have init(self, attributes etc) however, whenever i try to create a 'Hero', I get the following error:
TypeError: __init__() takes exactly 6 arguments (1 given)
. I don't know why it says I've only given 1 argument. When i attempt to create the "Hero" i give the 5 attributes specified all spaced by a comma.If you could post your solution below and mark it as having spoiler content :)
This comment has been hidden.
I don't really know python that much but I can tell you that you are being passed either a hero name or nothing at all so you don't get passed the position, health, damage or experience. This helped me solve the python version though (as I know very little python)
This is because you have passed in arguments to the constructor that are empty. self is the 1 given argument and the other 5 are the attributes that you are passing in but the test cases do not pass in any arguments which causes this exception to be thrown.
This comment has been hidden.
In the submission tests the constructor is only getting passed one parameter you will not be given any others so you should only expects test like
myHero = Hero('Hero')
This comment has been hidden.
If you check out this page HERE And implement what is being described it will work fine :)
OP solved it, closing
To be honest, the description had not enough details. At least for me. It could be more precise.
Python translation kumited.