Byte Heist Home Leaderboard
Join the Heist (with Github)
Solve View

Domain Name

Write “Hello, World!” to stdout, except your code must be a valid domain name (matches the regex /^(\w+.)+\w+$/)

Judge

(async function*(context: Context): Challenge {
  let isASCII = !!/^[\x00-\x7F]+$/.exec(context.code);
  let validDomainName = !!/^(\w+.)+\w+$/i.exec(context.code);
  // yield context.registerTestCase(
  //   new TestCase("ASCII source", isASCII ? "Pass" : "Fail",
  //                {"Text": `Only ASCII source code please`}));
  yield context.registerTestCase(
    new TestCase("Valid Domain Name", validDomainName ? "Pass" : "Fail",
                 {"Text": `Source code must be a valid domain name and match /^(\\w+.)+\\w+$/`}));
  yield (await context.run()).assertEquals('Hello, World!').setName('Source prints Hello, World!');
  return context.noFailures();
})

Example Code

SPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKERSPOILERBLOCKER=0;t=new Array;t.push`c\x6f\x6e\x73\x6f\x6c\x65\x2e\x6c\x6f\x67\x28\x22\x48\x65\x6c\x6c\x6f\x2c\x20\x57\x6f\x72\x6c\x64\x21\x22\x29\x2f\x2f`instanceof Array;eval(t+t)instanceof Array