Ad
  • Custom User Avatar
    console.log("<canvas id='myCanvas' width='200' height='100'style='border:1px solid #000000;'></canvas>")
    

    Putting this in the tests on a published kata and running them outputs a canvas with a red rectangle on it. I doubt a live kata based on this would be permitted, because the script tag is scary, which is why I suggested locking that down and offering supported methods.

    EDIT: This originally had script tags but, unsurprisingly, Codewars ate them. I followed the canvas tag with valid script tags in the same line.

  • Custom User Avatar

    I can't figure out how to do that, Josh. Doesn't look like you can console.log a script tag, to actually write to the canvas?

  • Custom User Avatar

    You can actually output a canvas the same way you output text but it would be nice to lock down tag output and support thing likes canvas with the UI.