Ad
  • Custom User Avatar
    /workspace/node/test.js:7
    import { expect, test } from 'vitest';
    ^^^^^^
    
    SyntaxError: Cannot use import statement outside a module
        at Object.compileFunction (node:vm:360:18)
        at wrapSafe (node:internal/modules/cjs/loader:1088:15)
        at Module._compile (node:internal/modules/cjs/loader:1123:27)
        at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
        at Module.load (node:internal/modules/cjs/loader:1037:32)
        at Module._load (node:internal/modules/cjs/loader:878:12)
        at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
        at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
        at async Promise.all (index 0)
        at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
        at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15)
        at async formattedImport (/workspace/node/node_modules/.pnpm/mocha@10.2.0/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
        at async exports.requireOrImport (/workspace/node/node_modules/.pnpm/mocha@10.2.0/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
        at async exports.loadFilesAsync (/workspace/node/node_modules/.pnpm/mocha@10.2.0/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
        at async singleRun (/workspace/node/node_modules/.pnpm/mocha@10.2.0/node_modules/mocha/lib/cli/run-helpers.js:125:3)
        at async exports.handler (/workspace/node/node_modules/.pnpm/mocha@10.2.0/node_modules/mocha/lib/cli/run.js:370:5)
    
  • Custom User Avatar

    I'm not going get into a flame war right now, but generally speaking, closing issues that are not fixed is frowned upon.

    As for the duplicate, here is just one example of another kata outside of beta that's done this task before, and decyrption is trivial in this case.

    Generally speaking, codewars beta isn't a great platform for coding schools to use for projects or assignments.

  • Custom User Avatar
    • needs random tests
    • while the story is novel, the concept of conditional logic isn't new enough or exciting enough for this kata to likely ever exit beta
  • Custom User Avatar
    • needs random tests
    • very likely a duplicate of many of the other caesar shift katas outside of beta
  • Custom User Avatar

    Liked this one a lot, great job (again ;P).

  • Custom User Avatar

    ha! muscle memory ;P

  • Custom User Avatar

    good question. My authoring days are likely over so I'm not really an authority on this one, but I think either one would be fine. Codegolf tends to do well when there are a few ways to solve and not a single prescribed method. I don't know if that's going to be the case here. Flip a coin maybe? ;P

  • Custom User Avatar

    realistically the performance kata's get fewer completions (compared to their non-performance counterparts) and hence, by my own observation, remain in beta. I honestly don't know what the best approach is here. The other kata appears to be fairly well received too.

    ^agreed about the performance constraints right now.

  • Custom User Avatar

    Couple things to consider.

  • Custom User Avatar
    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 207, in __
        test.expect(len(sol_code)<=200, f"Code is too long, length of code: {len(sol_code)} which is greater than {limit} by {len(sol_code)-200} characters")
                                                                                                                   ^^^^^
    NameError: name 'limit' is not defined
    
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Unfortunately this kata has been done before and therefore makes this a duplicate https://www.codewars.com/kata/city-swim-2d-towerflood-and-plainflood

  • Custom User Avatar

    Probablity isn't my strong suit, but the description seems a bit confusing to me.

    The function returns True if the player should roll again (when the probability of scoring is above their acceptable threshold), and False otherwise (when the probability of getting any points is below their threshold level of risk).

    roll_again(1, 0.50) -> True # Explanation: With one die, the chance of scoring (1 or 5) is 1/3, which is below a 50% threshold, suggesting a roll again.

    Based on the description it should return False, no?

  • Custom User Avatar

    Nice one as usual. I'm really not happy with my spaghetti code though XD

  • Custom User Avatar

    A few problems:

    • it's a duplicate
    • it needs random tests
    • the initial code setup uses the wrong function name
  • Loading more items...