← 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.

9 models responded

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 charact...
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: ```javascript function meowMorse(str) { const morseMap = ...
deepseek/deepseek-reasoner Β· 2026-03-02
Claude OpusAnthropic
medium6.0

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": ```javascript function meowMorse(text) { // Morse code mapping const morseCode = { 'A': '.-', 'B': '-...', 'C...
anthropic/claude-opus-4-20250514 Β· 2026-03-01
Claude SonnetAnthropic
medium5.4

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: ```javascript function meowMorse(text) { // Morse code mapping const morseCode = { 'A': '.-', 'B': '-...', 'C': '...
anthropic/claude-sonnet-4-20250514 Β· 2026-03-01
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 ...
openai/gpt-4o Β· 2026-03-01
Claude HaikuAnthropic
medium3.8

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 ```javascript function meowMorse(text) { // Morse code dictionary const morseDict = { 'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.', 'F': '....
anthropic/claude-haiku-4-5-20251001 Β· 2026-03-01
Phi-4Microsoft
medium3.4

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.
```javascript 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': 'ME...
ollama/phi4 Β· 2026-03-01
medium2.0

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 stri...
gemini/gemini-2.5-flash Β· 2026-03-02
high1.4

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.
```javascript function meowMorse(s) { const morseCode = { 'A': 'MEOW', 'B': '--..--', 'C': '-.-.--', 'D': '..---.', 'E': '.----.', 'F': '..-.-.', 'G': '--.-.', 'H': '....-', 'I': '...
ollama/llama3.1:8b Β· 2026-03-01