🎮ArcadeLab

Word Ladder Partner Cards

by SwiftWave91
30 lines3.9 KB
▶ Play
<!doctype html>
<html lang="en">
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
<title>Word Ladder Partner Cards</title>
<style>
  * { box-sizing:border-box } body { color:#172b28; background:#f6f3e8; font:17px/1.55 system-ui,sans-serif; margin:0 }
  main { max-width:640px; margin:0 auto; padding:2rem 1rem } h1,h2 { line-height:1.15 } h1 {font-family:Georgia,serif}
  article { background:white; border:1px solid #a9b8ac; border-radius:10px; padding:1.25rem; margin:1.25rem 0 }
  button { font:inherit; color:#16483a; background:white; border:1px solid #24674e; border-radius:5px; padding:.45rem .72rem; cursor:pointer }
  button:focus-visible,a:focus-visible { outline:3px solid #bb7104; outline-offset:3px } .words {display:flex;gap:.5rem;flex-wrap:wrap} .words button {font:700 1.05rem monospace;letter-spacing:.12em}
  output {display:block; min-height:2.4em; margin:.85em 0} a {color:#176044} #trail {font:700 1.1rem/1.7 monospace} @media print {article,footer,button,output,#trail,#turn {display:none} details,details>ol {display:block!important}}
</style>
<main><h1>Word Ladder Partner Cards</h1>
<p>Two readers, one screen. The builder chooses the next word. The checker names the letter that changed and its position. Swap roles after every move.</p>
<article aria-labelledby="mission"><h2 id="mission"></h2><p id="turn"></p>
<p id="trail" aria-label="Your route"></p><div id="cards" class="words"></div>
<output id="feedback" aria-live="polite"></output><button id="restart">Restart this round</button> <button id="next">Next round</button></article>
<details><summary>Paper version and teacher key</summary><p>Write the words in each row on separate slips, shuffle the middle words and keep both ends visible. Ask the pair to explain each move. These are example routes using the supplied cards.</p><ol id="key"></ol></details>
<footer><p>Need an individual sheet or another starting pair? <a href="https://getwordladder.com/doublets-word-ladder-worksheets" target="_blank" rel="noopener noreferrer">Print the Doublets word-ladder worksheets</a> with a separate answer key.</p><p>CC0 classroom activity from Word Ladder.</p></footer></main>
<script>
const routes = [ ['EAST','LAST','LEST','WEST'], ['COLD','CORD','CARD','WARD','WARM'], ['PINE','LINE','LIME','LAME','LAMP'], ['WALK','WALL','WELL','WEAL','SEAL'] ];
let index=0, trail=[];
const get=id=>document.getElementById(id);
function shuffled(words){ const result=words.slice(); for(let i=result.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[result[i],result[j]]=[result[j],result[i]]}return result }
function render(){const route=routes[index];const complete=trail.at(-1)===route.at(-1);get('mission').textContent=`${route[0]} → ${route.at(-1)}`;get('turn').textContent=complete?'Both readers: trace your route aloud.':`Reader ${trail.length%2?'A':'B'} builds. Reader ${trail.length%2?'B':'A'} checks.`;get('trail').textContent=trail.join(' → ');get('cards').replaceChildren();if(complete)return;for(const word of shuffled(route.filter(w=>!trail.includes(w)))){const button=document.createElement('button');button.textContent=word;button.onclick=()=>choose(word);get('cards').append(button)}}
function choose(word){const last=trail.at(-1);const changes=[0,1,2,3].filter(i=>last[i]!==word[i]);if(changes.length!==1){get('feedback').textContent=`${last} → ${word} changes ${changes.length} letters. Try a card with three unchanged letters.`;return}const p=changes[0];trail.push(word);get('feedback').textContent=`Position ${p+1}: ${last[p]} becomes ${word[p]}. ${word===routes[index].at(-1)?'Ladder complete!':'Swap roles.'}`;render()}
function start(){trail=[routes[index][0]];get('feedback').textContent='Choose a card that differs by exactly one letter.';render()}
get('restart').onclick=start;get('next').onclick=()=>{index=(index+1)%routes.length;start()};for(const route of routes){const li=document.createElement('li');li.textContent=route.join(' → ');get('key').append(li)}start();
</script></html>

Game Source: Word Ladder Partner Cards

Creator: SwiftWave91

Libraries: none

Complexity: simple (30 lines, 3.9 KB)

The full source code is displayed above on this page.

Remix Instructions

To remix this game, copy the source code above and modify it. Add a ARCADELAB header at the top with "remix_of: word-ladder-partner-cards-swiftwave91" to link back to the original. Then publish at arcadelab.ai/publish.