Ad
  • Custom User Avatar
  • Custom User Avatar

    Needs everything :(

    Test cases especially

  • Custom User Avatar

    Ok, just wanted to make sure, thanks.

  • Custom User Avatar

    For 2., do you mean in approx in the test cases?

  • Custom User Avatar
  • Custom User Avatar

    Yeah, those were my thoughts exactly.

  • Custom User Avatar

    A<=B, not A>=B as described in code and description, please fix.

  • Custom User Avatar

    That explains a lot. Thanks for the feedback, someone already beat me to fixing it.

  • Custom User Avatar
  • Custom User Avatar

    I had that issue. My error was because I had array's within the array (eg [1,2,3,[1,2],3]), and the test cases can't compare the values because of the multiple arrays inside of the array.

  • Custom User Avatar

    Wow! That image helps out a lot!

  • Custom User Avatar

    I kinda accounted for that. But yeah, calenders are dumb.

    But if paxompaxom wanted to, he could do that and then use a random time generator.

    Is there a chance that Feb 29th occurs in let date = new Date(2000, 0, Math.random() * 20 * 365 + 1 | 0).toISOString().slice(0, 10);?

  • Custom User Avatar

    Here's a random date generator I made so you can use an actual Date of Birth for the random tests. I made the year from 2000-2022, cow's have a life exepectancy of about 20 years.

    var date = "";
    var year = "20" + Math.floor(Math.random()*22).toString().padStart(2,"0");
    var month = (Math.floor(Math.random()*12)+1)
    var day = Math.floor(Math.random()*31)+1;
    var hour = Math.floor(Math.random()*24).toString().padStart(2,"0");
    var min = Math.floor(Math.random()*60).toString().padStart(2,"0");
    if (month == 2){
        if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) day = Math.floor(Math.random()*29)+1;
        else day = Math.floor(Math.random()*28)+1;
    }
    else if (month == 4 || month == 6 || month == 9 || month == 11){
        day = Math.floor(Math.random()*30)+1;
    }
    month = month.toString().padStart(2,"0")
    date = year+"-"+month+"-"+day.toString().padStart(2,"0")+ " " + hour +":"+min;
    
    // random outputs:
    // 2003-12-18 13:42
    // 2016-05-23 02:28
    // 2010-10-20 02:24
    // 2000-03-01 21:37
    // 2008-08-06 11:58
    
  • Custom User Avatar

    Also, this part kidna confuses me.

    Next, a string of the form <id><name><dateOfBirth> is formed from the fields - id, name, dateOfBirth. The name field is padded with spaces at the end of up to 10 characters.

    The resulting string is converted into a byte array — each character of the string is assigned a corresponding ASCII code (a number from 0 to 255).

    Is this just one string composed of all 3 forms combined (with name being a string with a length of 10)? Or is it 3 seperate strings?

    Edit, I think I figured this part out. It's <[id]><[name]><[dateOfBirth]>. I recommend putting an example like <0123456789><wisper cow><2019-06-11 00:00>

  • Custom User Avatar

    Thanks! This will make it way easier for people to decode the image and know what they'll have to print.

  • Loading more items...