← Code Generation
Code Generation #2

Write a JavaScript function called `meowMorse` that converts a string to morse code, but uses "meow" for dots and "MEOW" for dashes. Spaces between words should be represented by "😺". Include at least two test cases.

14 models responded

Claude FableAnthropic
high9.7

Judge: Verified by running under Node: all four test outputs match the claimed expected values exactly, morse mappings are correct, and meow/MEOW and the cat-emoji word separator are all per spec. The ' | ' letter separator makes output unambiguous and is well explained. Tests cover single letters, words, multi-word input, numbers, and extra whitespace, though there are no assertions and no empty-string case.

meowMorse 🐱 function meowMorse(input) { const morseMap = { a: '.-', b: '-...', c: '-.-.', d: '-..', e: '.', f: '..-.', g: '--.', h: '....', i: '..', j: '.---', k: '-.-', ...
anthropic/claude-fable-5 Β· 2026-06-11
GPT-5.4OpenAI
high9.0

Judge: Valid JavaScript using 'meow' for dots and 'MEOW' for dashes with 3 test cases; verified to run and produce correct morse output (SOS, Hi Cat with word spacing). Clean modern JS. Tests are demonstrative console.logs covering different input types rather than assertions, and one inline expected-output comment has a minor transcription slip.

function meowMorse(str) { const morseMap = { A: ".-", B: "-...", C: "-.-.", D: "-..", E: ".", F: "..-.", G: "--.", H: "....", I: "..", J: ".---", K: "-.-", L: ".-..", M:...
openai/gpt-5.4 Β· 2026-06-11
GPT-5.5OpenAI
high8.7

Judge: I executed the code in Node: both test outputs exactly match the expected comments, with correct morse mappings, meow/MEOW for dots/dashes, and the cat emoji between words. It robustly handles case, extra whitespace, digits, punctuation, and unknown characters, and uses clean modern JS with a sensible ' / ' letter separator. Tests meet the two-case minimum and cover word spacing, but use console.log rather than assertions and skip edge cases like empty strings.

function meowMorse(str) { const morseMap = { A: ".-", B: "-...", C: "-.-.", D: "-..", E: ".", F: "..-.", G: "--.", H: "....", I: "..", J: ".---", K: "-.-", L: ".-..", M:...
openai/gpt-5.5 Β· 2026-06-10
high8.0

Judge: Complete, valid JavaScript with verifiably correct expected outputs for both tests ('SOS' and the mixed alphanumeric multi-word 'Hi 2 U'). Global regex replaces are safe here, letters join with spaces, and words join with the required emoji. Minor gaps: unknown characters become empty strings that leave stray spaces (no filter), and tests are demonstrations rather than assertions with no empty-string/punctuation coverage.

function meowMorse(str) { const morseMap = { A: ".-", B: "-...", C: "-.-.", D: "-..", E: ".", F: "..-.", G: "--.", H: "....", I: "..", J: ".---", K: "-.-"...
openai/gpt-5.4-mini Β· 2026-06-10
DeepSeek V4DeepSeek
high8.0

Judge: Executed in Node: both tests produce exactly the expected output, with correct morse mappings, meow/MEOW symbols, and emoji word separation. One design weakness: letters within a word are joined by the same single space used between symbols, so letter boundaries are indistinguishable in the output (not decodable), though the prompt didn't strictly require it. Clean, well-commented modern JS; tests are adequate but lack assertions and edge cases.

function meowMorse(str) { // Morse code mapping for letters and digits const morseMap = { A: '.-', B: '-...', C: '-.-.', D: '-..', E: '.', F: '..-.', G: '--.', H: '....', I: '..', J:...
deepseek/deepseek-v4-pro Β· 2026-06-10
o4-miniOpenAI
high7.4

Judge: Valid JavaScript with correct morse table, proper use of meow/MEOW substitution, and cat emoji word separator. Function name is meowMorse as required. Two test cases provided (SOS and HELLO WORLD) with inline explanation. Clean modern JS style using map/filter/join chains. Minor gap: doesn't handle edge cases like empty strings or special characters gracefully.

Here’s one way to do it. We: 1. Define a lookup table from letters/digits to β€œ.​-” Morse. 2. In meowMorse() we split the input on spaces to get words. 3. For each word, we convert each character...
openai/o4-mini Β· 2026-03-02
DeepSeek R1DeepSeek
medium6.2

Judge: The function structure is clean and uses modern JS (map/filter/join). Morse code mappings look correct. The replacement approach (dots then dashes) has a subtle bug: replacing '.' first with 'meow' then '-' with 'MEOW' works because the replacements don't contain the other character. However, the listed expected outputs for test cases are incorrect -- 'CAT' shows emoji separators between letters of the same word, and 'HELLO WORLD' output is truncated/wrong. The function logic is likely correct but the test case outputs are wrong, undermining confidence.

Here's a JavaScript function that converts a string to Morse code using "meow" for dots and "MEOW" for dashes, with "😺" for word spaces: function meowMorse(str) { const morseMap = { 'A':...
deepseek/deepseek-reasoner Β· 2026-03-02
Claude OpusAnthropic
medium6.0
Run 1 of 2

Judge: Correct morse code mapping, proper function structure, uses 'meow'/'MEOW' substitution approach. Response truncated before completion so we can't verify test cases or full word-spacing logic. The visible code is clean modern JS with a comprehensive morse table. Truncation means we can't confirm test cases are present, which is a hard constraint.

Here's a JavaScript function that converts text to "meow morse code": function meowMorse(text) { // Morse code mapping const morseCode = { 'A': '.-', 'B': '-...', 'C': '-.-.', 'D...
anthropic/claude-opus-4-20250514 Β· 2026-03-01avg: 7.7
Claude SonnetAnthropic
medium5.4
Run 1 of 2

Judge: Function structure is correct and idiomatic JS. The morse code mapping is standard. However, there's a significant bug: replacing dots and dashes with 'meow'/'MEOW' without separators means '.-' becomes 'meowMEOW' -- the individual elements run together and can't be decoded. Response is truncated so test cases are incomplete, though it appears to include at least 2.

Here's a JavaScript function that converts text to "meow morse" code: function meowMorse(text) { // Morse code mapping const morseCode = { 'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-...
anthropic/claude-sonnet-4-20250514 Β· 2026-03-01avg: 6.6
GPT-4oOpenAI
medium4.4

Judge: The morse code mappings shown are correct and the approach is reasonable, but the response is truncated mid-object literal. Test cases are not visible, and the function body likely wasn't completed. Can only grade what's delivered.

Hard constraint failed: Response is truncated -- cannot confirm the function is complete valid JavaScript or that 2+ test cases are included.
Certainly! Here's a JavaScript function called meowMorse that converts a string to Morse code using "meow" for dots and "MEOW" for dashes. Spaces between words are represented by "😺". The function al...
openai/gpt-4o Β· 2026-03-01
Claude HaikuAnthropic
medium3.8
Run 1 of 2

Judge: Truncated mid-function β€” the morse dictionary is complete and correct, but the conversion logic and test cases are cut off. Can't verify correctness, meow/MEOW substitution, or test cases. The visible portion shows clean modern JS style with a complete morse dictionary.

Hard constraint failed: Code is truncated, not valid JavaScript, and no test cases are visible.
Meow Morse Code Converter function meowMorse(text) { // Morse code dictionary const morseDict = { 'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.', 'F': '..-.', 'G': '--....
anthropic/claude-haiku-4-5-20251001 Β· 2026-03-01avg: 4.9
Phi-4Microsoft
medium3.4
Run 1 of 2

Judge: The response is truncated mid-dictionary, so no test cases are visible and the function is incomplete β€” failing the hard constraint of including at least 2 test cases. The morse dictionary contains formatting errors (spaces in entries like 'MEOW- MEOW-meow' for G) and uses hyphens as separators within letters which could conflict with morse separation. The approach is reasonable but execution is broken.

Hard constraint failed: Must include at least 2 test cases β€” response is truncated before any test cases appear.
const meowMorse = (string) => { // Morse code dictionary with "meow" as dot and "MEOW" as dash. const morseDict = { 'a': 'meow-MEOW', 'b': 'MEOW-meow-meow-meow', 'c': 'MEOW-meow-MEOW-m...
ollama/phi4 Β· 2026-03-01avg: 3.5
medium2.0
Run 1 of 2

Judge: Response is truncated mid-code β€” the morseCodeMap object is cut off partway through letter I. No complete function, no test cases visible. The approach described (replacing dots with 'meow' and dashes with 'MEOW') is correct conceptually but the code is incomplete and cannot run.

Hard constraint failed: Code is truncated and incomplete. No test cases are included.
The meowMorse function converts a given string into a "meow"-themed Morse code. It replaces standard Morse dots (.) with "meow" and dashes (-) with "MEOW". Spaces between words in the input string are...
gemini/gemini-2.5-flash Β· 2026-03-02avg: 5.0
high1.4
Run 1 of 2

Judge: Fundamentally broken. The morse code dictionary has 'MEOW' for A but standard dots/dashes for all other letters -- it never converts dots to 'meow' or dashes to 'MEOW' as required. The function outputs standard morse with emoji separators, completely missing the core requirement. Two test cases are present but they'd produce wrong output.

Hard constraint failed: Must use 'meow' for dots and 'MEOW' for dashes -- the implementation uses standard dots and dashes for all letters except A.
function meowMorse(s) { const morseCode = { 'A': 'MEOW', 'B': '--..--', 'C': '-.-.--', 'D': '..---.', 'E': '.----.', 'F': '..-.-.', 'G': '--.-.', 'H': '....-', 'I': '..--', 'J': '....
ollama/llama3.1:8b Β· 2026-03-01avg: 1.5