Draft

Oh! My Money!

Description
Loading description...
Regular Expressions
Strings
  • Please sign in or sign up to leave a comment.
  • twypsy Avatar

    The first 2 test cases are clearly broken, as they ask you to return the value as a Number, instead of a string.

  • K1ngMX Avatar

    (javascript) i dont get why the first two tests should return numbers, but later ones (even the ones without ",") should return strings. Am i missing something ?

  • PG1 Avatar

    Nice Kata

  • matt c Avatar
    • cliffstamp Avatar

      That isn't a duplicate, it is a more involved kata.

      However unnamed has noted an expact duplicate in the above.

      Issue marked resolved by cliffstamp 6 years ago
  • owade Avatar

    Function name should be money and not twoOldestAges!Also kata needs more random tests.

  • myjinxin2015 Avatar

    几个问题: 1、用户代码编辑界面的初始代码应该是:

    function money(s){
      
    }
    

    2、example test里面缺少测试的例子 3、总体测试太少,而且没有随机测试,用户很容易硬编码通过。(参见我的欺骗解决方案) 4、kata描述不清晰,没有说明输入类型是什么(我一直以为你给的参数应该是字符串,实际上是数字型),是否需要考虑非法的输入参数(比如当参数是数组、null、undefined应该怎么办,如果需要测试这些,就说明这种情况应该返回什么值,如果不需要测试,就明确对用户说明不需要考虑这些情况),也没有说明应该返回什么类型的值(不过好在很好猜,应该是字符串)。 5、这种kata(给金额加逗号)我已经做了好几个了,有点重复了,建议多创造一些有新意的kata。 如果这是你的第一个kata,还是值得鼓励的,至少你成功地把它发布出来了,尽管有点问题,但是加油!;-)

    • matt c Avatar

      I think it's better to use english when commenting on kata's this is because now not every one who may contribute to the solving of this issue can aid the kata creator.. as a suggestion for the future...

    • smile67 Avatar

      Ok, my Chinese is not the best (English too) so it was very stressful to translate, but for you i did it and here it is...:

      A few questions: 1, the initial code code editor user interface should be:

      function money (s) {

      } 2, example test which lack examples of test 3, the overall test is too small, and there is no random testing, users can easily through hard-coded. (See my cheat solution) 4, kata description is not clear, did not specify what type of input is (I always thought you should be a string argument to actually numeric), the need to consider illegal input parameters (for example, when the parameter is an array, null, undefined how should I do, if you need to test them, to explain this situation should return to what values, if you do not test, you do not need to explain clearly to the user to consider these circumstances), also did not say what type of value should be returned (but the good news is good guess, should be a string). 5, the kata (amount to a comma) I have done several, a little repeated, it is recommended to create some innovative kata. If this is your first kata, or encouraged, at least you manage to put it out there, though a little problem, but come on! ;-)

      Maybe it's a little joke??? ;-)

    • matt c Avatar

      Thanks for translating :) most of them are fixed.

    • siebenschlaefer Avatar
      Issue marked resolved by siebenschlaefer 7 years ago
  • smile67 Avatar

    Not enough tests, no random tests;-)...

  • mattcollier Avatar

    function template is for twoOldestAges and there are no sample tests.