7 kyu

Categorize New Member

78,433 of 174,678Brynx
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • AlexBob_ Avatar

    This comment has been hidden.

  • Asilver-jpg Avatar

    Is there a way we can see the edgecase testing and random tests? My code passes the normal tests but I cannot begin to debug why it is failing the edge cases. This is in the TS version.

  • metatable Avatar
  • SharonGloria Avatar

    Is there a reason why I'm failing the tests despite the expected solution being ok? Maybe I am missing something.

  • ejini战神 Avatar

    This comment has been hidden.

  • jaeakins1 Avatar

    This comment has been hidden.

  • Furstenfeld Avatar

    This comment has been hidden.

  • marianpg12 Avatar

    This comment has been hidden.

  • Mr david Avatar

    I am ajust a beginner and i didnot understand anything so can one of u guys can make it breif to me

  • alexusfied Avatar

    The instrunctions were kinda confusing for me. At first I understood that in order to be senior, the handicap would have to be lower than 7. Made sense in my mind, because I thought to be a senior you would have to have a good handicap. Only after the first test I understood that it is meant to be the other way around. Might help to adjust the instructions a bit, so it becomes clearer. Or it's just me, not having the slightest idea about croquet clubs and handicaps ¯_(ツ)_/¯

  • Kymro Avatar

    im having an issue where my test cases seem to be giving the opposite results of what they should be, for example one test case was [[83,-2],[29,5],[15,22],[23,12]]

    and all of my results were open, however the test results said that none of them should equal open.

    all of those cases should be open, correct?

  • mcbrewa Avatar

    This comment has been hidden.

  • adriconte Avatar

    Hello everyone, a question, after solving the code that I can do, will I gain any experience to increase my level or something like that? Is the solution saved or do we post it somewhere?

  • punkbibi Avatar

    I passed the kata and my code works when i attemped and submited it, but while testing it i get this error:

    Traceback (most recent call last): File "/workspace/default/.venv/lib/python3.11/site-packages/codewars_test/test_framework.py", line 112, in wrapper func() File "/workspace/default/tests.py", line 8, in basic_test_cases test.assert_equals(open_or_senior(),['Open', 'Senior', 'Open', 'Senior']) ^^^^^^^^^^^^^^^^ TypeError: open_or_senior() missing 1 required positional argument: 'data'

    if needed i can also show the code.

  • JosephOler Avatar

    This comment has been hidden.

  • AlexGav1084 Avatar

    This comment has been hidden.

  • Caped Baldy Avatar

    Why is (255,1) a senior? Should it not be open? since the handicap is less than 7 and if (255,1) is senior then why is (73,1) considered open?

  • a-a-GiTHuB-a-a Avatar

    Bad test case?

    One test case sets the age to 45 and the handicap to 12. The rules clearly state that the age must be at least 55 and the handicap be over 7, but this person is apparently a senior, anyway.

  • Edsam2002 Avatar

    why is my test working but my attempt is failing??

  • Thor-Pedo Avatar

    Is the "handicap greater than 7" line meaning they are better (lower handicap) or worse (bigger handicap)? The tests kinda make it clear, but I think that can be confusing

  • omgpiu Avatar

    There's a bug in test, for this input [ [ 45, 12 ], [ 55, 21 ], [ 19, -2 ], [ 104, 20 ] ], we got

    expected [ 'Open', 'Open', 'Open', 'Open' ] to deeply equal [ 'Open', 'Senior', 'Open', 'Senior' ] But [55,21] and [104,20] for Senior.

  • Burnnet00 Avatar

    Why (73,1) = 'Open'?

  • de4alt Avatar

    It raised an error, but in VSC it works fine

    STDERR: Traceback (most recent call last): File "/workspace/default/tests.py", line 2, in from solution import open_or_senior ImportError: cannot import name 'open_or_senior' from 'solution' (/workspace/default/solution.py)

    When I [ATTEMPT] it then it returns this:

    STDERR: Traceback (most recent call last): File "/workspace/default/tests.py", line 4, in from solution import openOrSenior as open_or_senior ImportError: cannot import name 'openOrSenior' from 'solution' (/workspace/default/solution.py)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "/workspace/default/tests.py", line 6, in from solution import open_or_senior ImportError: cannot import name 'open_or_senior' from 'solution' (/workspace/default/solution.py)

  • ineedtherapy Avatar

    for age = 75 and handicap = 7, expected OPEN

    what? isnt that suppose to be senior? age is atleast above 55, and handicap is equal to 7, therefore; the member meets the requirements for the senior label, what am i doing wrong here.

  • beglari Avatar

    This comment has been hidden.

  • Asmox Avatar

    This comment has been hidden.

  • aandrusky Avatar

    Why is the example input a list of lists, and the test cases are lists of tuples?

  • user3831273 Avatar

    I use python. I Pasted the code into pycharm and it worked fine! But here it is saying some random bullcrap. Just why???

  • PKabitskiy Avatar

    This comment has been hidden.

  • VanyaMark Avatar

    This comment has been hidden.

  • Dugglubasya Avatar

    this site is broken bro; i wrote a simple solution but its saying some nonsense about ">= not supported between instances of tuple and int"

    so i copied&pasted into vscode my solution, gave it one of the basic test cases and IT WORKED, you dont understand how unbelievably angry i am right now

    p.s. i used python

  • KayleighWasTaken Avatar
  • Varndatic Avatar

    Hello! I simply want to ask people who has been programming for awhile (preferably with work experience) wether they find Linq to be a best practice or not? I'm a C++ programmer so boiler code and complexity is nothing new to me. Which is also why I prefer to write function bodies with regular loops/recursion. But linq has the advantage of one liners and looking amazing, but often suffer in performance and at time clearity for larger queries. So I'm asking the precent Linq spokes-ppl and us performance maniacs to endulge in a conversation of pros and cons :)

    I'll Start:

    I find Linq to be an amazing tool, providing both clarity (more often then not), one line syntax, easier querries and easier maintanability. But at the same time it suffers greatly in performance, and as a C++ developer in his Core, I enjoy performance and cache locality. Which Is why I often prefer the use of regular iterations through loops and recursion (call me conservative if you like). But Linq is something I still enjoy using for fetching data especially collections since those add operations tend to be nasty.

  • Kug_Fu Avatar

    Man, you wrote that the better the skill, the lower the rank => rank -2 - 7 the better players(Seniors). But in output you expect completely different result.

  • solaroptic Avatar

    This comment has been hidden.

  • badhandbanana Avatar

    This comment has been hidden.

  • tri@ Avatar
  • Sagits Avatar

    the output is below,still dont know whats different.

    Basic Test Cases

    Log ['Open', 'Senior', 'Open', 'Senior']

    None should equal ['Open', 'Senior', 'Open', 'Senior']

    Log ['Open', 'Open', 'Senior', 'Open']

    None should equal ['Open', 'Open', 'Senior', 'Open']

    Completed in 0.04ms

  • P3truts Avatar

    For C# I have 'Expected: "null"' for the Random Test Cases and there are no indications as to where there are "null" results, just "Senior" and "Open".

    I have seen that for some Python users there was a limit of 25 for the age. I tried if the age was under 18 then the result is "null" as opposed to the expected strings. Somehow Codewars just made all my results "null" not just the true tests. I verified it in Visual Studio and it worked but not here.

    Regardless, I think you should at least mention the expected null test cases if not remove it entirely.

  • user5763476 Avatar

    Nice kata description! :0)

  • p4nu Avatar

    Java translation is ready for review! (Author inactive)

  • trashy_incel Avatar

    C translation (author inactive)

  • 张文夫 Avatar

    This comment has been hidden.

  • Magmafish Avatar

    This comment has been hidden.

  • BegadTarek Avatar

    Hi! For JS, in the Kata Description you made the pairs in (), however in the test cases each pair is an array []. This causes an issue where the code is right, but you need to make sure the function is looking for an array. A simple correction to the Description should fix this issue, thanks!

  • Codingnovice Avatar

    My code works fine until i attempt it and it fails sometimes 3 or 10 times. When i input the data for one of the failed scenarios, it returns the correct answer. Not sure what the issue is here

  • DanyloUserGit Avatar

    This comment has been hidden.

  • Abstrxk Avatar

    This comment has been hidden.

  • muktedm Avatar

    for the millionth time, my code works fine in pycharm .........why does not it work on codewars. what do i have to do ....

  • CassiuSRSA Avatar

    This comment has been hidden.

  • deyanValkov Avatar

    hi i have finished the kata and when i am testing on my Vscode it works ok and returns exactly what is expected to return but when ia pres attempt it fails on 3 tests and it says seniop or open not defined by the context i can not figure out can somebody help please thanks

  • Khaled  Mourad Avatar

    in this kata. I finished the challenge and when i clicked test button its print out You passed all tests :).but, when I clicked attempt for trying to submit its print out "Passed: 2 Failed: 1 Exit Code: 1" Please, Can anyone told me what is the issue?

  • aschnackenberg Avatar

    This comment has been hidden.

  • jessed Avatar

    The example data in the instructions had a list of lists, but the data actually received was a list of tuples. This should be fixed in the instructions

  • endless7z Avatar

    This comment has been hidden.

  • FlatSix Avatar

    This comment has been hidden.

  • bogdzzz Avatar

    This comment has been hidden.

  • MadisIlves Avatar

    JS if i console.log(data) i get empty array in random tests: [[], [], [], [], [], [], [], [], [], []]

    And i fail the test because : Expected: '['Open', 'Senior', 'Open', 'Senior', 'Open', 'Senior', 'Senior', 'Open', 'Senior', 'Open']', instead got: '['Open', 'Open', 'Open', 'Open', 'Open', 'Open', 'Open', 'Open', 'Open', 'Open']'

  • SpeekPC Avatar

    My solution is correct in 98 of 105 cases and i cant find the issue :C. Any tip?

  • user5977748 Avatar

    Nice kata, but in Python, I believe the function should be called open_or_senior, not openOrSenior.

  • MagnusTroll Avatar

    At some point (probably when the kata was modified to conform to PEP-8), the input data on Python 3.8 was changed from lists within lists to tuples. This means none of the upvoted solutions work as-written anymore.

    This is still probably a 7 kyu since the problem can be fixed within the solution, but the instructions are no longer accurate.

  • sleeptil3 Avatar

    Tricky wording with lower handicap meaning a better score, but they ask for a handicap greater than 7, where in golf I'd say greater than 7 indicates less than by the rules of how handicaps are applied value;.

  • carandev Avatar

    Hi, my answer is the correct but the output say: Expected: '['Open', 'Senior', 'Open', 'Senior']', instead got: 'undefined' and my output is [ 'Open', 'Senior', 'Open', 'Senior' ]

  • Bilo Avatar

    This comment has been hidden.

  • Qbig Avatar

    I really don't know what to return. have never worked with "IEnumerable" or pretty much anything like it. I was using an ArrayList to save the categories and if i try to return it i get an error "Cannot implicitly convert type 'System.Collections.ArrayList' to 'System.Collections.Generic.IEnumerable'"

  • elwinjyot Avatar

    I don't understand wheather I should give importance to age or handicap value whilst categorising

  • micheal11 Avatar

    This comment has been hidden.

  • IusedToBeALawyer Avatar

    In my opinion isntruction should mention that there are tuples in the list, not lists inside the list.

  • bregmi1 Avatar

    This comment has been hidden.

  • paolodipietro Avatar

    This comment has been hidden.

  • mujthaba.mk Avatar

    This comment has been hidden.

  • akiko14 Avatar

    est.assert_equals(open_or_senior([(16, 23),(73,1),(56, 20),(1, -1)]) these should be list nested in list, not set nested in list

  • max_brkfst Avatar

    The 2nd sample test for Python appears to have an error. The 73-year-old should be in 'Senior' category.

    test.assert_equals(open_or_senior([(16, 23),(73,1),(56, 20),(1, -1)]),['Open', 'Open', 'Senior', 'Open'])

  • Martom04 Avatar

    This comment has been hidden.

  • cyqsimon Avatar

    In Rust, the return type really should be Vec<&str>. This is considered more idiomatic since String dereferences to &str.

    This turns the function signature into:

    fn open_or_senior<'a>(data: Vec<(i32, i32)>) -> Vec<&'a str>
    
  • MatJoss Avatar

    This comment has been hidden.

  • TheRosenOne Avatar

    This comment has been hidden.

  • Crushed Avatar

    it was not clear how invalid data should be handled.

  • JaredCTravis Avatar

    This comment has been hidden.

  • user9738573 Avatar

    This comment has been hidden.

  • sickatheart Avatar

    Why is the handicap range from -2 to +26 and the test values exceed +25. Wasted so much time to just change handicap >=8 from handicap >= 8 and handicap <= 26

  • ignaraph Avatar

    This comment has been hidden.

  • Kiwimon Avatar

    This comment has been hidden.

  • JpCordeiro5626 Avatar

    Hey guys, My code is completely right and so is the answer, but the interpreter keeps saying that my log is wrong. I don't get this "Expected menssage". Can anyone help me ?

    Log: [ 'Open', 'Senior', 'Open', 'Senior' ] Expected: '['Open', 'Senior', 'Open', 'Senior']', instead got: 'undefined'

  • ReturnOfTheMac Avatar

    This comment has been hidden.

  • Dareos Khalili Avatar

    This comment has been hidden.

  • Einherjar  Avatar

    In python the tests were expecting the function to be named open_or_senior but the provided code template names the function "openOrSenior".

  • Craiger20 Avatar

    This comment has been hidden.

  • Chrono79 Avatar

    The user can mutate the input in Python (at least). The expected result should be obtained first.

  • tPehthd Avatar

    This comment has been hidden.

  • WestwardLand968 Avatar

    Python: Function name should use snake_case as per PEP8.

  • heitoruchoa Avatar

    This comment has been hidden.

  • tanzil786 Avatar

    I have an issue related this ['Open', 'Open', 'Open', 'Open', 'Senior', 'Open', 'Open', 'Open', 'Open', 'Open', 'Senior', 'Open'] it is printing this many timees what should I do

  • artomich Avatar

    This comment has been hidden.

  • sunchipstoogood Avatar

    This comment has been hidden.

  • dragonthief Avatar

    This comment has been hidden.

  • luca-montaigut Avatar

    There is an issue in Ruby. Tests are : Test.assert_equals(openOrSenior([[45, 12],[55,21],[19, -2],[104, 20]]),['Open', 'Senior', 'Open', 'Senior']) Test.assert_equals(openOrSenior([[3, 12],[55,1],[91, -2],[54, 23]]),['Open', 'Open', 'Open', 'Open']) Test.assert_equals(openOrSenior([[59, 12],[55,-1],[12, -2],[12, 12]]),['Senior', 'Open', 'Open', 'Open']) Test.assert_equals(openOrSenior([[16, 23],[73,1],[56, 20],[1, -1]]),['Open', 'Open', 'Senior', 'Open'])

    But for the number 3 : Test.assert_equals(openOrSenior([[59, 12],[55,-1],[12, -2],/!\issue => [12, 12]]),['Senior', 'Open', 'Open', 'Open']) data[3][0] return 68 instead of 12 data[3][1] return 7 instead of 12

  • snip31337 Avatar

    So my output is: ['Open', 'Senior', 'Open', 'Senior'] And the error is: <class 'list'> should equal ['Open', 'Senior', 'Open', 'Senior'] Whoever tells me why this fails gets a coffee on me...

  • Karlsoon Avatar

    Log ['Open', 'Open', 'Open', 'Open', 'Open'] It should work for random tests too: None should equal ['Open', 'Open', 'Open', 'Open', 'Open']

  • losslessring Avatar

    There is a mistake in Instructions

    "To be a senior, a member must be at least 55 years old and have a handicap greater than 7. In this croquet club, handicaps range from -2 to +26; the better the player the lower the handicap. "

    Following this logic - if lower handicap is better, then handicap greater than 7, should be < 7, not > 7

  • neoncitylights Avatar

    PHP translation added

  • Ankur960 Avatar

    This comment has been hidden.

  • antonvine Avatar

    This comment has been hidden.

  • oliversiket Avatar

    My JS code is working on the first one but not on the second and the third. Can anyone help me what could be the problem? It is just weird that it passes once and then it gives me "TypeError: Cannot read property '0' of undefined"...

  • larrylinus Avatar

    This comment has been hidden.

  • suic Avatar

    Groovy translation kumited. Please review and approve. Thanks, suic

  • suic Avatar

    F# translation:

    • actual and expected are in reverse order
    • it's very low quality! F# has tuples so why aren't they used in the translation???
  • user8436785 Avatar

    There are several translations waiting to be approved or rejected:

    C++ CoffeeScript TypeScript Java

    I didn't make them, but I noticed them in there. Some have been there for 3 years, and are just sitting there. What's goin'on?

  • user9057027 Avatar

    This comment has been hidden.

  • rosstrottier Avatar

    This comment has been hidden.

  • fredcode Avatar

    Testing for [[59, 26], [68, 4], [72, 1], [44, 21], [66, 14], [31, 5], [28, 0], [59, 21]] ['Senior', 'Open', 'Open', 'Open', 'Senior', 'Open', 'Open', 'Senior'] should equal ['Senior', 'Senior', 'Senior', 'Senior', 'Senior', 'Senior', 'Senior', 'Senior'] the random test is wrong it only returns senior in all list?????

  • CM_2000 Avatar

    I'm a brand new user and this is extremely difficult, if anyone could help point me in the right direction, that would be great

  • yoyofrenchfries Avatar

    This comment has been hidden.

  • nyct0phile Avatar

    Brand new user and so confused. I don't even know what the requirement is. Just write the function definition? Write the whole program including sample data? I don't understand at all. How to get help?

  • Naaman Avatar

    This comment has been hidden.

  • beardystudios Avatar

    This comment has been hidden.

  • Ciszowski Avatar

    This comment has been hidden.

  • petrak Avatar

    In python I am getting a SyntaxError: File "main.py", line 3 test.assert_equals(openOrSenior(return),['Open', 'Senior', 'Open', 'Senior']) ^ SyntaxError: invalid syntax Code works when I run it somewhere else.

  • sensishadow818 Avatar

    The description says to be a senior, you must have a handicap greater than 7. Not 7, but strictly greater. It only took my solution when I allowed handicp to be 7. Need to fix tests or description.

  • dborncamp Avatar

    I tried to do ipnut checking based on In this croquet club, handicaps range from -2 to +26 to ensure that we had valid handicaps (as well as an age above 0). But in the random tests I got bad handicaps and was told it failed when I raised an exception. Is this expected behaviour?

  • khovey Avatar

    Every time I submit an attempt the random test returns

    Expected and actual are both <System.String[10]> Values differ at index [2] Expected: null But was: "Open"

    I am not sure why the random test would return a null, does anyone have suggestions?

  • JL-J Avatar

    This comment has been hidden.

  • IslaMurtazaev Avatar

    I think that you should add "Don't mutate the input!" to the description.

  • user1778083 Avatar

    Ruby conventions use snake_case. Please use snake_case.

  • imranh27 Avatar

    Hi Everyone, new to Codewars (liking it!), may Iask for your input?

    so when I run the tests for my solution, the Log says.. ['Open', 'Senior', 'Open', 'Senior'] and the warning says None should equal ['Open', 'Senior', 'Open', 'Senior'], which is right?

    My results match the output for the tests, but the tests are failing? I am not sure why..? (this is with version 2.7.6 and 3.4.3)

    Thanks!

  • renmanimel Avatar

    This comment has been hidden.

  • activenode Avatar

    It says "the better the player the LOWER the handicap" which actually in mathematical terms would state that it must be < 8 and not > 7 !

  • FrozenPigs Avatar

    This comment has been hidden.

  • grisza.karamazow Avatar

    The test does not work for Python 3 at all and for Python 2 random test outcome is always like ['Senior', 'Senior' ... 'Senior'] and the Kata cannot be completed.

  • 09riche Avatar

    Hello, the tests seem to be broken for Ruby. My code works fine in repl.it and passes all the sample tests, but when I submit I get the following message:

    Expected: ["Senior", "Open", "Open", "Open"], instead got: ["Senior", "Open", "Open", "Senior"]

  • cheekjustin Avatar

    hi im new can maybe somone help me a little bit im tryin to elarn this programming to start a career when i graduate high school

  • sganger Avatar

    This comment has been hidden.

  • maxolotl Avatar

    This comment has been hidden.

  • NohaBadawy Avatar

    hey guys! i can't get the final output in one list of strings: this is my output:

    ['Open'] ['Open'] ['Senior'] ['Open']

    it should look like that ['Open', 'Open','Senior','Open']

    thanks!

  • Ze-Marcos Avatar

    I have a translation for you in F#

  • MochaCat Avatar

    Why Senior needs more handicap ?

  • datdavidw Avatar

    This comment has been hidden.

  • kp098 Avatar

    This comment has been hidden.

  • 960761 Avatar

    This is my first try of CodeWar, when I complete my test function, I cannot find where to test it , when I click "Attempt" button below ,it will pop up a message says "Failed to communicate to code execution service." I am totally new to this tool, so could someone kindly tell me what is wrong. Thanks a lot!

  • FlowerCoder Avatar

    This comment has been hidden.

  • yh2n Avatar

    This comment has been hidden.

  • aamick Avatar

    This comment has been hidden.

  • iavalen1 Avatar

    This comment has been hidden.

  • annie31 Avatar

    I am getting the output in the correct format, still it is unacceptable. I don't understand why.

  • ZimChristine Avatar

    This is my first Kata, so being a beginner Codewars user could have something to do with my difficulty. I welcome your feedback.

    When I print the contents (with console.log) of my array of 'Open' or 'Senior' members, I get the correct output. But the Test Results from 'Run Examples' fails. Instead of the 'Expected' output, the Test Results outputs 'undefined.' That's not my goal. Obviously.

    What are your suggestions? Thanks!

  • keishasperkins Avatar

    This comment has been hidden.

  • Lorkes Avatar

    Random tests are broken in Python 3.4.3

    Testing for [[49, 16], [60, 21], [61, 3], [62, 19], [64, 18], [42, 18], [69, 1], [66, 21]]

    Every test got TypeError: unorderable types: str() >= int()

  • CatSoup Avatar

    Hey, I'm getting an error when I solve this challenges. I get a message that says 'There was a server issue while sending the request. Please try again'. This is also happening in other challenges. I can't work like this. Any suggestions?

  • TENsaga Avatar

    The initial tests pass, but are the extended test suite broken for this question?

    Testing for [[44, -2], [61, 15], [27, 20], [44, 8], [40, -1], [43, 24], [44, 18]] Log ["Open", "Senior", "Open", "Open", "Open", "Open", "Open"] #<ArgumentError: comparison of String with 55 failed> >=' block in solOOS' each' solOOS' block (3 levels) in <main>' block (2 levels) in

    ' `times'

  • ardinal Avatar

    [[], [], [], [], [], [], [], [], [], []] ? ✘ Expected: '['Senior', 'Open', 'Open', 'Open', 'Senior', 'Open', 'Senior', 'Open', 'Senior', 'Senior']', instead got: '['Open', 'Open', 'Open', 'Open', 'Open', 'Open', 'Open', 'Open', 'Open', 'Open']'

    random test cases seem to be wrong

  • cpugeek13 Avatar

    Random testing seems to be broken. Says that it should return an empty list.

  • alec99 Avatar
    me: 86ms Passed: 3 Failed: 1 Test Results: Basic tests Log [45, 12] [55, 21] 55 [55, 21] [19, -2] [104, 20] 104 [104, 20] ✔ Test Passed

    Log [3, 12] [55, 1] [91, -2] [54, 23] ✔ Test Passed

    Log [59, 12] 59 [59, 12] [55, -1] [12, -2] [12, 12] ✔ Test Passed

    Log [74, 10] 74 [74, 10] [55, 6] [12, -2] [68, 7] 68 [68, 7] ✘ ['Senior', 'Open', 'Open', 'Senior'] should equal ['Senior', 'Open', 'Open', 'Open']

    whats up with the last part of the test? did you guys have to do this as well? I dont understand the extra number????

  • ArturKp Avatar

    This comment has been hidden.

  • artkirienko Avatar

    Ruby translation: openOrSenior is a bad method name. Rename it to: open_or_senior

  • Zelouille Avatar

    Tests are broken in Python3 (3.4.3).

  • enpei.c Avatar

    No matter what case in random test, every member is regarded as 'Senior', please help to fix the problem.

  • lalaka Avatar

    Testing for [[27, 20], [81, 0], [42, 27], [46, 4], [46, -1], [61, 9], [65, 26]] It should work for random tests too: ['Open', 'Open', 'Open', 'Open', 'Senior', 'Senior'] should equal ['Open', 'Open', 'Open', 'Open', 'Open', 'Senior', 'Senior']

    Why [42, 27] is defined as 'Open' if there only max 26 handicap? Maybe it should be neither Open nor Senior?

  • monicamow Avatar

    I have all the correct answers but it says it "instead got nil"...

  • mansi Avatar

    It's very helpful to get to know so many implementation. But i will suggest you should also say that the best practice to solve this is using the map function of the array instead of another functions like for and foreach

  • Imonar Avatar

    This code is not working. I HAD the same exact answer as one of the answers and it said it was wrong...

  • dvago Avatar

    This comment has been hidden.

  • mcruzat Avatar

    The better the player the lower the handicap. So if you are 55 years old and are a very good player with a handicap of 5, you can't be Senior, but if you aren't so good and have a handicap of 10 then you can. Don't you should change it, so a senior must have a handicap of 7 at most? - Regards

  • TheBMachine Avatar

    Testing for [[53, 21], [56, 19], [46, 24]] It should work for random tests too: ['Open', 'Senior', 'Open'] should equal ['Senior', 'Senior', 'Senior']

    The random tests seem to be wrong. First and last person are < 55 years old and shouldn't be Senior. (Python) In fact, in the random tests, it seems to expect every single person to be a Senior.

  • JisuPark Avatar

    This comment has been hidden.

  • comonad Avatar

    should a Senior really have a handicap "worse" than 8 ? that is, if he becomes better, he won't be a Senior anymore?

  • webadict Avatar

    The random tests in the Javascript kata seem to think that >8 is the correct result, as noted by the expected [90, 8] being listed as Open, instead of the Actual case of Senior.

    Some random tests:
    [[21,21],[75,11],[60,12],[55,10],[54,9],[1,1],[0,0],[90,9],[90,8]] ?
    Expected: ["Open","Senior","Senior","Senior","Open","Open","Open","Senior","Open"], instead got: ["Open","Senior","Senior","Senior","Open","Open","Open","Senior","Senior"]
    
    [[55,10],[60,12],[0,0],[1,1],[90,8],[75,11],[90,9],[54,9],[21,21]] ?
    Expected: ["Senior","Senior","Open","Open","Open","Senior","Senior","Open","Open"], instead got: ["Senior","Senior","Open","Open","Senior","Senior","Senior","Open","Open"]
    
    [[90,8],[90,9],[1,1],[55,10],[60,12],[21,21],[75,11],[54,9],[0,0]] ?
    Expected: ["Open","Senior","Open","Senior","Senior","Open","Senior","Open","Open"], instead got: ["Senior","Senior","Open","Senior","Senior","Open","Senior","Open","Open"]
    
    [[90,8],[0,0],[60,12],[90,9],[75,11],[54,9],[55,10],[1,1],[21,21]] ?
    Expected: ["Open","Open","Senior","Senior","Senior","Open","Senior","Open","Open"], instead got: ["Senior","Open","Senior","Senior","Senior","Open","Senior","Open","Open"]
    
    [[90,8],[90,9],[0,0],[54,9],[55,10],[60,12],[1,1],[75,11],[21,21]] ?
    Expected: ["Open","Senior","Open","Open","Senior","Senior","Open","Senior","Open"], instead got: ["Senior","Senior","Open","Open","Senior","Senior","Open","Senior","Open"]
    
  • nannooskeeska Avatar

    I think that one of your edge cases is wrong. In the spec it says that they must have a handicap greater than 7, but when I ran the edge case tests it said that the handicap must be greater than 8.

  • bkaes Avatar

    Haskell translation kumited. I used the handicap >7 condition, as stated in the description, not the one in the current JavaScript variant (>8).

  • bkaes Avatar

    A test case and the description conflict:

    To be a senior, a member must be at least 55 years old and have a handicap greater than 7.

    Test.assertSimilar(openOrSenior([[55,8],[55,9]]),['Open','Senior'], "handicap for 'Senior' should be > 8")
                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    

    This is in the JavaScript variant. The random tests also contain one wrong pair: [90,8].

  • dting Avatar

    This comment has been hidden.

  • GiacomoSorbi Avatar

    Too few test cases for now: if you wish I can easily add a good load of random tests to complete the kata.

    Also, your solution is probably wrong if you meant literally "greater than 8", as you put >7.

  • moosecode Avatar

    "To be a senior, a member must be at least 55 years old and must have a handicap of greater than 8" should be changed to "To be a senior, a member must be at least 55 years old and have a handicap greater than 8"

  • ZozoFouchtra Avatar

    JS translation kumited.