Overview › Models › deepseek-r1:32b
Model profile

deepseek-r1:32b

LocalBrain cluster
146/150answered (R31–R180)
4DNF / no usable answer
DNFno scored round

Rounds & answers 150

▶ R31 · Bat and ball (the classic reasoning trap) Open round →
**Lösung:**

Sei \( x \) der Preis des Balls in Euro. Der Schläger kostet dann \( x + 1{,}00\,\text{Euro} \).

Gemäß der Aufgabenstellung gilt:
\[
x + (x + 1{,}00\,\text{Euro}) = 1{,}10\,\text{Euro}
\]

Löse die Gleichung:
\[
2x + 1{,}00\,\text{Euro} = 1{,}10\,\text{Euro} \\
2x = 0{,}10\,\text{Euro} \\
x = 0{,}05\,\text{Euro}
\]

**Antwort:** Der Ball kostet \(\boxed{0{,}05\,\text{Euro}}\) (5 Cent).
▶ R32 · Four houses, four clues (constraint puzzle) Open round →
Um die Farbe jedes Hauses in der Reihe zu bestimmen, analysieren wir die gegebenen Fakten Schritt für Schritt.

### Gegebene Fakten:
1. **Das rote Haus steht direkt links vom blauen Haus**.
2. **Das grüne Haus steht an Position 1**.
3. **Das gelbe Haus steht direkt rechts vom blauen Haus**.

### Lösungsschritte:

1. **Fakt 2** sagt uns, dass das grüne Haus in Position 1 ist:
   - **Position 1**: Grün

2. **Fakt 1** und **Fakt 3** verbinden die Positionen von rotem, blauem und gelbem Haus miteinander:
   - Das rote Haus steht unmittelbar links des blauen Hauses.
   - Das gelbe Haus steht unmittelbar rechts des blauen Hauses.

3. Da das grüne Haus bereits in Position 1 ist, müssen die anderen Farben auf den verbleibenden Positionen verteilt werden:
   - **Position 2**: Blau
   - **Position 3**: Rot (direkt links von Blau)
   - **Position 4**: Gelb (direkt rechts von Blau)

### Endergebnis: …

Excerpt — the full answer is on the round page.

▶ R33 · Idioms that break literal translation (EN→DE) Open round →
1) 'to bite the bullet' - Sich auf den Sprung werfen  
2) 'the ball is in your court' -Jetzt liegt es an dir  
3) 'it's raining cats and dogs' - Es regnet wie aus Eimern
▶ R34 · Constrained taglines (word ban + length cap) Open round →
1. Premium bamboo - gentle on teeth.
2. Soft bristles protect your smile.
3. Clean mouth, gentle planet.
▶ R35 · Minutes in a (non-leap) year — show the math Open round →
Um die Anzahl der Minuten in einem normalen Jahr (365 Tage) zu berechnen, gehen wir wie folgt vor:

**Schritt 1:** Bestimmen Sie die Anzahl der Stunden pro Tag.

\[
1\ \text{Tag} = 24\ \text{Stunden}
\]

**Schritt 2:** Bestimmen Sie die Anzahl der Minuten pro Stunde.

\[
1\ \text{Stunde} = 60\ \text{Minuten}
\]

**Schritt 3:** Multiplizieren Sie die Anzahl der Tage, Stunden und Minuten miteinander, um die Gesamtzahl der Minuten im Jahr zu erhalten.

\[
365\ \text{Tage} \times 24\ \text{Stunden/Tage} \times 60\ \text{Minuten/Stunde} = 525\,600\ \text{Minuten}
\]

**Endergebnis:**

\[
\boxed{525600}
\]
▶ R36 · Continue the sequence (doubling gaps) Open round →
**Lösung:**

Die gegebene Zahlenreihe ist: **2, 3, 5, 9, 17, ?**

Um die Regel zu identifizieren, betrachten wir die Differenzen zwischen aufeinanderfolgenden Zahlen:

\[
\begin{align*}
3 - 2 &= 1 \\
5 - 3 &= 2 \\
9 - 5 &= 4 \\
17 - 9 &= 8 \\
\end{align*}
\]

Wir sehen, dass jede Differenz das **Doppelte** der vorherigen Differenz ist:

\[
\begin{align*}
1 \times 2 &= 2 \\
2 \times 2 &= 4 \\
4 \times 2 &= 8 \\
\end{align*}
\]

Folglich wird die nächste Differenz **\(8 \times 2 = 16\)** sein. Um die nächste Zahl in der Reihe zu erhalten, addieren wir diese Differenz zur letzten bekannten Zahl:

\[
17 + 16 = \boxed{33}
\]

**Regel:** Jede Zahl wird durch das Vorhergehende Plus das Doppelte des letzten Unterschieds berechnet.
▶ R37 · False friend: 'control' EN→DE Open round →
Bevor wir liefern, muss ich die Testergebnisse kontrollieren und schließlich zwei Bugs beheben.
▶ R38 · Register shift: formal → casual (DE) Open round →
Hallo Lisa, wollte dich informieren, dass die Besprechung auf morgen um 10 Uhr verschoben wurde. Viele Grüße, [Name]
▶ R39 · 40-word product blurb with 3 required words Open round →
Edelstahl-Trinkflasche: auslaufsicher, spülmaschinenfest und mit 500ml Kapazität. Hält Inhalte stundenlang warm oder kalt. Premium-Qualität für tägliches Gebrauch.
▶ R40 · isPalindrome (ignore case & non-alphanumerics) Open round →
function isPalindrome(s) {
    const cleaned = s.toLowerCase().replace(/[^a-z0-9]/g, '');
    return cleaned === cleaned.split('').reverse().join('');
}
▶ R41 · Prose → valid JSON Open round →
{
  "name": "Anna Schmidt",
  "age": 30,
  "city": "Freiburg",
  "hobbies": ["Lesen", "Radfahren"],
  "newsletter": true
}
▶ R42 · All but nine (word-problem trap) Open round →
Um die Anzahl der noch am Leben befindlichen Schafe zu berechnen, ziehen wir die Anzahl der verstorbenen Schafe von der Gesamtzahl ab:

\[
17 \text{ (Gesamtschafe)} - 9 \text{ (Verstorbene)} = 8
\]

**Antwort:**  
\boxed{8}
▶ R43 · Five machines (rate-reasoning trap) Open round →
**Antwort:**

\boxed{5}

**Begründung:**

1. **Gegeben:** 5 Maschinen brauchen 5 Minuten, um 5 Teile herzustellen. Das bedeutet, jede Maschine produziert jeweils ein Teil in 5 Minuten.
2. **Skalierung:** Wenn die Anzahl der Maschinen auf 100 gestiegen wird, können gleichzeitig 100 Teile gefertigt werden.
3. **Zeitbleibend:** Da jede Maschine unabhängig voneinander arbeitet und jeweils ein Teil in 5 Minuten fertiggestellt wird, benötigen die 100 Maschinen ebenfalls nur 5 Minuten für 100 Teile.

Daher beträgt die benötigte Zeit:

\boxed{5}
▶ R44 · Appointment extraction to strict JSON Open round →
[
  {
    "datum": "2026-08-12",
    "uhrzeit": "15:30",
    "titel": "Budgetplanung"
  },
  {
    "datum": "2026-09-03",
    "uhrzeit": "09:00",
    "titel": "Zahnarzttermin"
  },
  {
    "datum": "2026-12-31",
    "uhrzeit": "20:30",
    "titel": "Silvesterparty"
  }
]
▶ R45 · Idiom-dense German to natural English Open round →
"That's not exactly the cream of the crop, but leave well enough alone — all in all, we can live with it."
▶ R46 · Energy conservation on a frictionless incline Open round →
Given a 2 kg block sliding down a frictionless incline, dropping a height of 5 m, we need to calculate the block's speed and kinetic energy at the bottom using energy conservation.

First, we use the principle of energy conservation where the potential energy (PE) at the top converts into kinetic energy (KE) at the bottom. The formulas used are:

\[ \text{PE} = mgh \]
\[ \text{KE} = \frac{1}{2}mv^2 \]

Since all potential energy is converted into kinetic energy:

\[ mgh = \frac{1}{2}mv^2 \]

The mass \( m \) cancels out, simplifying to:

\[ gh = \frac{1}{2}v^2 \]
\[ v^2 = 2gh \]
\[ v = \sqrt{2gh} \]

Plugging in the given values (\( g = 9.8 \, \text{m/s}^2 \) and \( h =
▶ R47 · Unit conversion: km/h to m/s and mph Open round →
**Solution:**

We are tasked with converting a car's speed from kilometers per hour (km/h) to two different units:

1. **Meters per second (m/s)**
2. **Miles per hour (mph)**

Let's go through each conversion step by step.

---

### (a) Conversion to Meters Per Second (m/s)

**Given:**  
\( 108 \, \text{km/h} \)

**Conversion Factors:**
- \( 1 \, \text{km} = 1000 \, \text{m} \)
- \( 1 \, \text{hour} = 3600 \, \text{seconds} \)

**Steps:**

1. **Convert kilometers to meters:**  
   Multiply by \( 1000 \) to convert kilometers to meters.
   \[
   108 \, \text{km/h} \times 1000 \, \frac{\text{m}}{\text{km}} = 108,000 \, \frac{\text{m}}{\text{h}}
   \]

2. **Convert hours to seconds:**  
   Divide by \( 3600 \) to convert hours to seconds.
   \[
   108,000 \, \frac{\text{m}}{\text{h}} \div 3600 \, \frac{\text{s}}{\text{h}} = 30 \, \frac{\text{m}}{\text{s}}
   \]

**Final Answer (a):**
\[
\bo …

Excerpt — the full answer is on the round page.

▶ R48 · Low-orbit satellite: speed and period (orbital/Kepler estimate)DNF Open round →
No usable answer reached the harness in this round.
▶ R49 · Ohm's law: resistance and power dissipation Open round →
To solve the problem, we'll use **Ohm's Law** and the formula for electrical power.

### (a) Calculating the Resistance of the Resistor

**Ohm's Law** states:
\[
V = I \times R
\]
Where:
- \( V \) is the voltage across the resistor,
- \( I \) is the current through the resistor,
- \( R \) is the resistance.

We are given:
- \( V = 12 \, \text{V} \)
- \( I = 0.5 \, \text{A} \)

Rearranging the formula to solve for \( R \):
\[
R = \frac{V}{I}
\]
Substituting the given values:
\[
R = \frac{12 \, \text{V}}{0.5 \, \text{A}} = 24 \, \Omega
\]

**Final Answer:**
\[
\boxed{24 \, \Omega}
\]

### (b) Calculating the Electrical Power Dissipated

The **power dissipated** in a resistor can be calculated using:
\[
P = V \times I
\]
Where:
- \( P \) is the power,
- \( V \) is the voltage,
- \( I \) is the current.

Using the given values:
\[
P = 12 \, \text{V} \times 0.5 \, \text{A} = 6 \, \text{W}
\] …

Excerpt — the full answer is on the round page.

▶ R50 · Thin lens equation: image distance and magnificationDNF Open round →
No usable answer reached the harness in this round.
▶ R51 · Heat required to warm water (specific heat capacity) Open round →
To determine the heat energy required to raise the temperature of water from \(20^\circ C\) to \(80^\circ C\), we'll use the formula:

\[
Q = m \times c \times \Delta T
\]

**Given:**
- Mass (\(m\)) = 2 kg
- Specific heat capacity of water (\(c\)) = 4186 J/(kg·K)
- Initial temperature (\(T_{\text{initial}}\)) = \(20^\circ C\)
- Final temperature (\(T_{\text{final}}\)) = \(80^\circ C\)

**Step 1: Calculate the change in temperature (\(\Delta T\))**

\[
\Delta T = T_{\text{final}} - T_{\text{initial}} = 80^\circ C - 20^\circ C = 60 \, ^\circ C
\]

Since the temperature difference is the same in Kelvin and Celsius:

\[
\Delta T = 60 \, \text{K}
\]

**Step 2: Calculate the heat energy (\(Q\))**

Plugging the values into the formula:

\[
Q = 2 \, \text{kg} \times 4186 \, \frac{\text{J}}{\text{kg} \cdot \text{K}} \times 60 \, \text{K}
\]

\[
Q = 2 \times 4186 \times 60
\]

\[
Q = 502,\!320 \, …

Excerpt — the full answer is on the round page.

▶ R52 · Fermi estimate: how many piano tuners in a 10-million-person city?DNF Open round →
No usable answer reached the harness in this round.
▶ R53 · Why is the sky blue? (conceptual) Open round →
The sky appears blue during the day because of a phenomenon called Rayleigh scattering. Sunlight, which is composed of various colors, enters Earth's atmosphere where it interacts with molecules and small particles. Blue light, having a shorter wavelength, scatters much more than other colors. This scattered blue light comes from all parts of the sky, making it appear blue to us. Our eyes are also more sensitive to blue light, which contributes to this perception.
▶ R54 · Time dilation: why do moving clocks run slow? (conceptual, special relativity) Open round →
In special relativity, the concept of time dilation explains why each observer perceives the other's clock as running slower when they are in relative motion. Here's a step-by-step explanation:

1. **Relative Motion and Frames**: Consider two observers, Alice and Bob, moving relative to each other. Each is stationary in their own inertial frame of reference.

2. **Time Dilation**: Due to special relativity, each observer measures the other's clock as running slower. This occurs because time isn't absolute; it depends on the observer's frame of reference.

3. **Relativity of Simultaneity**: Events that appear simultaneous to one observer may not be so for another. Thus, Alice and Bob don't agree on what "now" means for each other, contributing to the symmetry in their observations.

4. **No Preferred Frame**: Unlike Newtonian physics, there's no absolute rest frame in special relativity. …

Excerpt — the full answer is on the round page.

▶ R55 · The double-slit experiment and wave-particle duality (conceptual, quantum mechanics) Open round →
The double-slit experiment elegantly illustrates the concept of wave-particle duality in quantum mechanics. Here's a clear breakdown:

1. **Without a Detector**: When particles (like electrons or photons) are fired one at a time through two slits, they initially behave as waves. Over time, an interference pattern emerges on the screen, characterized by alternating bright and dark bands. This occurs because each particle interacts with itself as if it passed through both slits simultaneously, demonstrating wave-like interference.

2. **With a Detector**: When a 'which-path' detector is added to observe which slit each particle passes through, the interference pattern disappears. Instead, two distinct bands appear on the screen, corresponding to particles passing through one slit or the other. This change happens because the act of measurement forces the particles to behave like classical …

Excerpt — the full answer is on the round page.

▶ R56 · Double-slit interference, particle by particle Open round →
```html
<!DOCTYPE html>
<html><head><title>Double Slit Experiment</title></head><body style="background:#000;display:flex;flex-direction:column;align-items:center;">
<canvas id="c" width=800 height=400></canvas>
<div id="count" style="color:#fff;font-family:sans-serif;">Particles detected: 0</div>

<script>
const canvas = document.getElementById('c');
const ctx = canvas.getContext('2d');
const slits = [ {x:350, y:180}, {x:450, y:180} ];
let particles = [];
let hits = [];
let count = 0;
let animationId;

ctx.fillStyle='#000';
ctx.fillRect(0,0,canvas.width,canvas.height);
ctx.strokeStyle='#fff';
ctx.lineWidth=2;
ctx.beginPath();
slits.forEach(s => {
    ctx.moveTo(s.x-5,s.y-10);
    ctx.lineTo(s.x+5,s.y+10);
});
ctx.stroke();

function fireParticle() {
    const x = slits[0].x + (Math.random()-0.5)*25;
    particles.push({x:x, y:slits[0].y+30, vx:4, vy:0});
}

function animate() {
    ctx. …

Excerpt — the full answer is on the round page.

▶ R57 · Hanging rope with Verlet integration Open round →
```html
<!DOCTYPE html>
<html><body style="background:#000;margin:0;display:flex;justify-content:center;align-items:center;height:100vh">
<canvas id="c"></canvas>
<script>
const canvas=document.getElementById("c"),ctx=canvas.getContext("2d");
canvas.width=800;canvas.height=400;
let points=[],constraints=[],anchorX1=350,anchorY1=100,anchorX2=450,anchorY2=100,gap=100,gravity=0.1,mass=1;
for(let i=0;i<40;i++){
    let x=i==0?anchorX1:i==39?anchorX2:anchorX1+(i*(gap)/38);
    let y=i==0||i==39?anchorY1+i*(anchorY2-anchorY1)/39:200;
    points.push({x,y,px:x,py:y});
}
function connect(a,b,distance){
    constraints.push({a,b,distance});
}
for(let i=0;i<40-1;i++)connect(points[i],points[i+1],i==0||i==39?gap/2:gap/38);
let lastTime=0,impulseInterval=5000,lastImpulse=0;
function animate(timestamp){
    if(!lastTime)lastTime=timestamp;
    let dt=(timestamp-lastTime)/1000;
    if((timestamp-lastI …

Excerpt — the full answer is on the round page.

▶ R58 · 2D wave propagation with reflection Open round →
```html
<!DOCTYPE html><html><head><style>body{margin:0;overflow:hidden;background:#000}</style></head><body><canvas id="c"></canvas><script>
const canvas = document.getElementById('c'), ctx = canvas.getContext('2d');
const W=120,H=90,scale=3,SIZE_W=W*scale,SIZE_H=H*scale;
let grid=[[0]],next=[[0]],x,y,t=0,damping=.995,timeStep=.1;

function initGrid() {
  grid = Array(W).fill().map(()=>Array(H).fill(0));
  next = Array(W).fill().map(()=>Array(H).fill(0));
}

function addPulse() {
  const cx=Math.random()*W, cy=Math.random()*H,r=6;
  for(let i=0;i<W;i++)for(let j=0;j<H;j++){
    const dx=i-cx, dy=j-cy, dist2=dx*dx+dy*dy;
    if(dist2<r*r)grid[i][j]=(Math.cos(Math.sqrt(dist2)/r*Math.PI)-.5)*.1;
  }
}

function wave() {
  for(let i=0;i<W;i++)for(let j=0;j<H;j++){
    const left=i>0?next[i-1][j]:next[1][j]*damping,
          right=i<W-1?next[i+1][j]:next[W-2][j]*damping,
          up=j>0?ne …

Excerpt — the full answer is on the round page.

▶ R59 · Billiard break with spin and friction Open round →
```html
<!DOCTYPE html>
<html><body style="background:#333;margin:0;display:flex;justify-content:center;align-items:center;height:100vh">
<canvas id=c width=640 height=480></canvas>
<script>
b=[];t=null;speed=.2;tgt={x:320,y:295};size=20;friction=.99
class Ball{constructor(x,y,vx,vy,r,n){this.x=x;this.y=y;this.vx=vx;this.vy=vy;this.r=r||size;this.n=n}
draw(){c.fillStyle='white';c.beginPath();c.arc(this.x,this.y,this.r,0,2*Math.PI);c.fill();}
move(){this.x+=this.vx*=friction;this.y+=this.vy*=friction;if(Math.abs(this.vx)<.1&&Math.abs(this.vy)<.1)this.stop()}
stop(){this.vx=0;this.vy=0}
collide(b,a){let dx=b.x - a.x, dy=b.y -a.y,d=Math.sqrt(dx*dx+dy*dy);if(d < size*2){let nx=dx/d,ny=dy/d,vx1=b.vx,nx1=a.vx,vx2=a.vx,vy1=b.vy,vy2=a.vy
b.vx=vx1- (nx*(vx1 - vx2)+ ny*(vy1 - vy2))*nx*2
b.vy=vy1- (ny*(vy1 - vy2)+ nx*(vy1 - vy2))*ny*2
a.vx=nx1 + (nx*(vx1 - vx2)+ ny*(vy1 - vy2))*nx*2
a.vy=vy2 + (ny* …

Excerpt — the full answer is on the round page.

▶ R60 · Dijkstra vs A* on a weighted grid Open round →
```html
<!DOCTYPE html>
<html><head><title>Dijkstra vs A*</title></head><body style="background:#f0f0f0;display:flex;height:100vh;margin:0;padding:20px;gap:20px;flex-direction:column;">
<canvas id=c width=800 height=400 style="border:1px solid #ccc;"></canvas>
<div style="display:flex;gap:20px;">
  <div>Dijkstra: expanded <span id=d-expanded>0</span><br>Path cost: <span id=d-cost>0</span></div>
  <div>A*: expanded <span id=a-expanded>0</span><br>Path cost: <span id=a-cost>0</span></div>
</div>
<script>
const canvas = document.getElementById('c');
const ctx = canvas.getContext('2d');
const cols=30, rows=20;
let grid = Array(cols).fill().map(()=>Array(rows).fill().map(()=>Math.floor(Math.random()*5)+1));
let dijkstraQueue = new PriorityQueue();
let aStarQueue = new PriorityQueue();
let pathDijkstra = [];
let pathAstar = [];
let step=0;

class PriorityQueue {
  constructor() { this.elements …

Excerpt — the full answer is on the round page.

▶ R61 · Convex hull built step by step Open round →
```html
<!DOCTYPE html>
<html>
<head>
    <style>
        canvas{border:1px solid #ccc;display:block;margin:50px auto;background:#fff}
        body{background:#f0f0f0;font-family:sans-serif}
        #steps{position:absolute;top:20px;left:20px;color:#333;font-size:24px}
    </style>
</head>
<body>
<canvas id="c"></canvas><div id="steps">Step 0</div>
<script>
var c=document.getElementById('c'),ctx=c.getContext('2d'),w=800,h=600,points=[],hull=[],step=0,running=true;

function init(){
    c.width=w;c.height=h;points=genPoints();hull=[];step=0;running=true
}

function genPoints(){
    var pts=[];for(let i=0;i<40;i++)pts.push({x:Math.random()*w,y:Math.random()*h});
    pts.sort((a,b)=>(a.y==b.y?a.x-b.x:a.y-b.y));return pts
}

function cross(o,a,b){
    return (a.x-o.x)*(b.y-o.y)-(a.y-o.y)*(b.x-o.x)
}

function grahamScan(p,i=0,draw=true){
    if(i<points.length||running){
        let o=i>0?hu …

Excerpt — the full answer is on the round page.

▶ R62 · Huffman tree from letter frequencies Open round →
```html
<!DOCTYPE html><html><head><style>canvas{border:1px solid #ccc;display:block;margin:20px auto;background:#fff}body{background:#f0f0f0;font-family:monospace}</style></head><body>
<canvas id=c></canvas>
<script>
const ctx = document.getElementById('c').getContext('2d');
ctx.canvas.width=800;ctx.canvas.height=600;

let freq={},s="THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.",codes={};
for(let c of s)freq[c]= (freq[c]||0)+1;
delete freq[' '];
const nodes = Object.entries(freq).map(([c,f])=>({c,f,left:undefined,right:undefined,parent:undefined,weight:f}));
nodes.sort((a,b)=>a.weight - b.weight);

let animationState={phase:'build',nodesCopy:[],currentNodes:[...nodes],root:undefined,timer:0};
const phases=['build','assign codes','display results'];

function draw() {
  ctx.clearRect(0,0,800,600);
  
  if(animationState.phase === 'build'){
    // Draw priority queue
    ctx.fillStyle='#e …

Excerpt — the full answer is on the round page.

▶ R63 · Kruskal's MST with union-find Open round →
```html
<!DOCTYPE html>
<html><body style="background:#000;margin:0;display:flex;justify-content:center;align-items:center;height:100vh">
<canvas id=c></canvas>
<script>
const c=document.getElementById('c'),w=800,h=600;
let nodes=[],edges=[],count=0,total=0,frame=0,running=true;n=c.getContext('2d');
n.fillStyle='#000';n.fillRect(0,0,w,h);

function initNodes(){
nodes.length=0;for(let i=0;i<25;++i){nodes.push({x:Math.random()*w,y:Math.random()*h,c:i})}
}

function initEdges(){edges=[];count=total=0;n.fillStyle='#fff';n.font='18px Arial';
for(let i=0;i<nodes.length;++i)for(let j=i+1;j<nodes.length;++j){
const dx=nodes[i].x-nodes[j].x,dy=nodes[i].y-nodes[j].y,d=Math.sqrt(dx*dx+dy*dy);
edges.push({u:i,v:j,w:d})
}edges.sort((a,b)=>b.w - a.w)}

initNodes();initEdges();

function drawNode(n,x,y,c){
n.beginPath();n.arc(x,y,5,0,2*Math.PI);n.fillStyle=`hsl(${c*10},70%,60%)`;n.fill();
}

function d …

Excerpt — the full answer is on the round page.

▶ R64 · N-Queens solved by backtracking Open round →
```html
<!DOCTYPE html>
<html><head><title>Animating 8-Queens Backtracking</title></head><body style="background:#2c3e50;margin:0;display:flex;justify-content:center;align-items:center;height:100vh">
<canvas id="board"></canvas>
<div style="position:absolute;top:20px;color:white">Placements: <span id="places">0</span></div>
<div style="position:absolute;top:40px;color:white">Backtracks: <span id="back">0</span></div>

<script>
let canvas = document.getElementById('board'), ctx = canvas.getContext('2d');
let N, queens = [], attacking = new Set();
let places=0, back=0;
let solving = true;

function drawBoard() {
  canvas.width = Math.min(500, 40*N);
  canvas.height = canvas.width;
  ctx.fillStyle = '#3c6e8e';
  ctx.fillRect(0,0,canvas.width,canvas.height);
  
  // Draw chessboard
  let size = canvas.width/N;
  for(let i=0; i<N; i++) {
    for(let j=0; j<N; j++) {
      ctx.fillStyle = ((i+ …

Excerpt — the full answer is on the round page.

▶ R65 · Delaunay triangulation, triangle by triangle Open round →
```html
<!DOCTYPE html>
<html><head><title>Delaunay Triangulation</title><style>body{background:#1a1a1a;color:white;display:flex;flex-direction:column;align-items:center}canvas{border:solid 1px #333;margin:20px auto}.count{font-family:monospace;margin-bottom:10px}</style></head>
<body><div class="count">Points: <span id="points">0</span> / Triangles: <span id="tris">0</span></div><canvas id="canvas"></canvas>
<script>
const canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d');
let points = [], edges = new Set(), triangles = [];
const size = 500;
canvas.width = size; canvas.height = size;

function randomPoint() {
    return {x: Math.random()*size, y: Math.random()*size};
}

function circumCircle(p1, p2, p3) {
    let a = p1.x, b = p1.y, c = p2.x, d = p2.y, e = p3.x, f = p3.y;
    let A = a*(d-f)+c*(f-b)+e*(b-d);
    if(A == 0) return {r: Infinity};
    let B = (a*a + …

Excerpt — the full answer is on the round page.

▶ R66 · AVL tree rebalancing with rotations Open round →
```html
<!DOCTYPE html>
<html><head><meta charset="utf-8"></head><body style="background:#f0f0f0;">
<canvas id=c width=600 height=400></canvas>
<div style="position:absolute;top:10px;left:10px;background:white;padding:10px;">
Height: <span id=h>0</span><br>
Rotations: <span id=r>0</span>
</div>
<script>
class AVLNode {
    constructor(key) {
        this.key = key;
        this.left = null;
        this.right = null;
        this.balance = 0;
        this.x = 0;
        this.y = 0;
    }
}

class AVLTree {
    constructor() {this.root = null;}
    
    insert(root, key) {
        if(!root) return new AVLNode(key);
        if(key < root.key) root.left = this.insert(root.left, key);
        else root.right = this.insert(root.right, key);
        
        root.balance = this.height(root.right) - this.height(root.left);
        
        let balanceFactor = root.balance;
        if(balanceFac …

Excerpt — the full answer is on the round page.

▶ R67 · Sieve of Eratosthenes on a number grid Open round →
```html
<!DOCTYPE html>
<html><head><title>Sieve of Eratosthenes Animation</title><style>canvas{border:1px solid black}.info{position:absolute;top:20px;left:20px;font-family:sans-serif}</style></head><body>
<canvas id=c width=300 height=300></canvas><div class="info" id=i></div>
<script>
let c=document.getElementById('c'),ctx=c.getContext('2d'),w=300,h=300,s=12,nx=20,ny=20,primes=[],counts={current:0,totalPrimes:0,totalEliminated:0},currentNumber=2,step=2;
const sieve=[...Array(401)].map(_=>true);
sieve[0]=sieve[1]=false;

function drawGrid(){ctx.fillStyle='white';ctx.fillRect(0,0,w,h);for(let i=0;i<=nx+1;i++)for(let j=0;j<=ny+1;j++){let x=i*s,y=j*s;ctx.strokeStyle='lightgray';ctx.strokeRect(x,y,s,s)}}

function highlightPrime(n){let [x,y]=[n%nx,nx*Math.floor(n/nx)];ctx.fillStyle='lightblue';ctx.fillRect(x*s+1,y*s+1,s-2,s-2)}

function strikeThrough(m,p){let hue=(p*360/400)%360;ctx.fillS …

Excerpt — the full answer is on the round page.

▶ R68 · Edit-distance DP matrix with backtrace Open round →
```html
<!DOCTYPE html>
<html>
<head><title>Levenshtein Animation</title></head>
<body style="background:#f0f0f0;display:flex;flex-direction:column;align-items:center;">
<canvas id="matrix" width="540" height="360"></canvas>
<div id="edits" style="width:500;margin-top:1em;padding:10px;background:white;border-radius:5px;"></div>

<script>
const word1 = "substitute";
const word2 = "replacement";
let edits = [];
const canvas = document.getElementById('matrix');
const ctx = canvas.getContext('2d');
const m = word1.length, n = word2.length;
let dp = Array(m+1).fill().map(() => Array(n+1));
let i=0,j=0;

function init() {
  dp[0][0] = {cost:0};
  for(let x=0; x<=m;x++) for(let y=0;y<=n;y++) if(x==0 || y==0) dp[x][y] = {cost:x+y};
}

function drawMatrix() {
  let cellWidth = canvas.width / (Math.max(m,n)+1);
  ctx.strokeStyle = '#ccc';
  
  for(let x=0; x<=m+1; x++) {
    ctx.beginPath();
    c …

Excerpt — the full answer is on the round page.

▶ R69 · Replanning when the map changes Open round →
```html
<!DOCTYPE html>
<html><head><title>Robot Navigation</title><style>canvas{border:1px solid #ccc;display:block;margin:20px auto}body{background:#f0f0f0;text-align:center;font-family:sans-serif}</style></head><body>
<canvas id=c width=600 height=400></canvas>
<script>
let c=document.getElementById('c'),ctx=c.getContext('2d'),W=30,H=20,CELL=20,walls=[],robot={x:1,y:1},goal={x:28,y:18},path=[],steps=0,replans=0,running=true;
function drawGrid(){for(let y=0;y<H;y++)for(let x=0;x<W;x++)ctx.fillStyle='#f0f0f0',ctx.fillRect(x*CELL,y*CELL,CELL-1,CELL-1)}
function drawWalls(){walls.forEach(w=>{ctx.fillStyle='black';ctx.fillRect(w.x*CELL,w.y*CELL,CELL-1,CELL-1)})}
function drawRobot(){ctx.fillStyle='blue';ctx.beginPath();ctx.arc(robot.x*CELL+CELL/2,robot.y*CELL+CELL/2,CELL/2-.5,0,Math.PI*2);ctx.fill()}
function drawGoal(){ctx.fillStyle='green';ctx.fillRect(goal.x*CELL,goal.y*CELL,CELL-1,CELL …

Excerpt — the full answer is on the round page.

▶ R70 · Binary search, step by step Open round →
```html
<!DOCTYPE html>
<html><head><style>body{margin:0;display:flex;flex-direction:column;justify-content:center;height:100vh;background:#1a1a1a;color:white;font-family:sans-serif}.canvas-container{width:800px;margin:20px auto}.bars canvas{border:1px solid #333}.info{text-align:center;padding:10px}</style></head>
<body><div class="canvas-container"><div class="info">Target: <span id="target"></span> | Comparisons: <span id="comps"></span></div><div class="bars"><canvas width="800" height="400" id="barsCanvas"></canvas></div></div>
<script>
class BinarySearchVisualizer {
  constructor() {
    this.canvas = document.getElementById('barsCanvas');
    this.ctx = this.canvas.getContext('2d');
    this.array = [];
    this.low = -1;
    this.high = -1;
    this.middle = -1;
    this.target = -1;
    this.comparisons = 0;
    this.animationId = null;
    this.initialize();
  }

  generateArra …

Excerpt — the full answer is on the round page.

▶ R71 · Flood fill on a pixel grid Open round →
```html
<!DOCTYPE html>
<html>
<head><style>canvas{border:1px solid black} #controls {position:absolute;top:0;right:0;padding:5px}</style></head>
<body>
<canvas id="grid" width="600" height="400"></canvas>
<div id="controls">
    Filled: <span id="filled">0</span><br>
    Frontier: <span id="frontier">0</span>
</div>
<script>
const canvas = document.getElementById('grid');
const ctx = canvas.getContext('2d');
const cellSize = 10;
const width = canvas.width / cellSize;
const height = canvas.height / cellSize;
let grid = [];
let frontier = [];
let colors = [];
let filling = false;
const iterationsPerFrame = 4;

class Color {
    constructor(r, g, b) { this.r = r; this.g = g; this.b = b; }
    static random() {
        return new Color(Math.random(), Math.random(), Math.random());
    }
}

function init() {
    grid = [];
    frontier = [];
    colors = [];
    const numBlobs = Math.floor(M …

Excerpt — the full answer is on the round page.

▶ R72 · Maze generation by recursive backtracking Open round →
```html
<!DOCTYPE html>
<html><body style="background:#333;display:flex;justify-content:center;align-items:center;height:100vh;margin:0">
<canvas id="c"></canvas>
<script>
const canvas = document.getElementById('c');
const ctx = canvas.getContext('2d');
const CELL_SIZE = 20;
const MARGIN = 10;

// Initialize canvas
canvas.width = (30 * CELL_SIZE) + 2 * MARGIN;
canvas.height = (20 * CELL_SIZE) + 2 * MARGIN;

let stack = [];
let current;
let visited = [];
let wallsN = [];
let wallsE = [];
let wallsS = [];
let wallsW = [];

function initMaze() {
    stack.length=0; visited.length=0;
    for(let y=0;y<20;y++) {
        visited[y] = new Array(30).fill(false);
        wallsN[y] = new Array(30).fill(true);
        wallsE[y] = new Array(30).fill(true);
        wallsS[y] = new Array(30).fill(true);
        wallsW[y] = new Array(30).fill(true);
    }
    current = [Math.floor(Math.random()*30), Ma …

Excerpt — the full answer is on the round page.

▶ R73 · KMP string search with prefix table Open round →
```html
<!DOCTYPE html>
<html><head><title>KMP Animation</title></head><body style="background:#1a1a1a;color:white;font-family:monospace;">
<canvas id=c width=800 height=400></canvas>
<script>
let c=document.getElementById('c'),ctx=c.getContext('2d'),w=800,h=400;
let pattern,text,table,state,anim,x,y,scale,timer=0,count=0,matches=[],patternX=0;

function randomString(l){return [...Array(l)].map(_=>String.fromCharCode(97+Math.random()*26)).join('')}

function buildKMPTable(p){
  let table=[...p].map(() => 0);
  for(let i=1,j=0;i<p.length;){
    if(p[i]==p[j]){table[i++]=j++;}else{
      if(j) j=table[j-1]; else{table[i]=0;i++;}
    }
  }return table;
}

function init(){
  pattern=randomString(4);text=randomString(20);
  patternX=50; anim=0;x=50;y=200;s=30;scale=20;
  state='build';count=0;matches=[];table=buildKMPTable(pattern);
}

function drawText(s,y){
  ctx.fillStyle='#404040';
  s.sp …

Excerpt — the full answer is on the round page.

▶ R74 · Quadtree collision detection Open round →
```html
<!DOCTYPE html>
<html><body style="background:black;margin:0;display:flex;justify-content:center;">
<canvas id=c width=800 height=600></canvas>
<div id=s style="position:absolute;top:10px;left:10px;color:white;background:rgba(0,0,0,.5);padding:20px;"></div>
<script>
class Ball {
    constructor(x,y,r,vx,vy,c) {
        this.x = x; this.y = y; this.r = r;
        this.vx = vx; this.vy = vy; this.c = c;
        this.lastCollide = 0;
    }
}
class QuadNode {
    constructor(x1,y1,x2,y2){
        this.x1=x1;this.y1=y1;this.x2=x2;this.y2=y2;
        this.children=[];this.contents=[];
    }
    insert(b) {if(this.children.length){for(let c of this.children)if(c.contains(b))return c.insert(b);return this;}else{
        if(this.contents.length>3){
            if(!this.children.length){
                const m = ((this.x1 + this.x2)/2, (this.y1 + this.y2)/2);
                this.children …

Excerpt — the full answer is on the round page.

▶ R75 · Falling sand on a cell grid Open round →
```html
<!DOCTYPE html>
<html>
<head>
    <title>Sand Simulation</title>
    <style>
        canvas{border:1px solid #000;display:block;margin:20px auto;background:#fff}
        body{background:#1a1a1a;color:#fff;font-family:sans-serif;text-align:center}
        #stats{position:absolute;top:20px;left:50%;transform:translateX(-50%)}
    </style>
</head>
<body>
    <canvas id="c"></canvas>
    <div id="stats">Resting: 0 | Steps: 0</div>
    <script>
        const canvas = document.getElementById('c'), ctx = canvas.getContext('2d');
        let w = 150, h = 100;
        canvas.width = w * 2; canvas.height = h * 2;
        ctx.scale(2, 2);
        const GRID_EMPTY = 0, GRID_FALLING = 1, GRID_RESTING = 2;
        
        let grid = new Array(w).fill().map(() => new Array(h).fill(GRID_EMPTY));
        let resting = 0, steps = 0, maxParticles = w * h / 3, particles = [];
        
        funct …

Excerpt — the full answer is on the round page.

▶ R76 · Falling sand as free particles Open round →
```html
<!DOCTYPE html><html><head>
<style>body{margin:0;display:flex;flex-direction:column;align-items:center;background:#1a1a1a}
canvas{border:1px solid #333;margin-top:20px}.stats{color:white;padding:10px}</style>
</head><body>
<canvas id=c></canvas><div class=stats id=s>Particles active: 1500 | Height: 0px</div>
<script>
const canvas = document.getElementById('c'), cxt = canvas.getContext('2d');
let particles = [], w, h, stats = document.getElementById('s'), max_height = 0;

function resizeCanvas() {
    w = window.innerWidth * 0.8;
    h = window.innerHeight * 0.6;
    canvas.width = w;
    canvas.height = h;
}

window.addEventListener('resize', resizeCanvas);
resizeCanvas();

class Particle {
    constructor(x, y) {
        this.x = x || Math.random() * w;
        this.y = y || -Math.random() * 100;
        this.vx = (Math.random() - 0.5) * 2;
        this.vy = 0.1;
        this.ma …

Excerpt — the full answer is on the round page.

▶ R77 · Crowd leaving a room, cell by cell Open round →
```html
<!DOCTYPE html>
<html><body style="background:#1a1a1a;display:flex;flex-direction:column;align-items:center;">
<canvas id=c></canvas>
<div style="color:white;font-family:sans-serif;">People left: <span id=p>60</span>, Steps: <span id=s>0</span></div>
<script>
const canvas = document.getElementById('c');
const ctx = canvas.getContext('2d');
const GRID_W = 40;
const GRID_H = 30;
const EXIT_X = GRID_W - 1;
const EXIT_Y = GRID_H - 1;
const CELL_SIZE = 8;
const RADIUS = CELL_SIZE * 0.4;
canvas.width = GRID_W * CELL_SIZE;
canvas.height = GRID_H * CELL_SIZE;

let grid = [];
let people = [];
let step = 0;

function init() {
    grid = Array(GRID_H).fill().map(() => Array(GRID_W).fill(0));
    // Add obstacles
    for(let y = 0; y < GRID_H; y++) {
        for(let x = 0; x < GRID_W; x++) {
            if(y === 0 || y === GRID_H -1 || x === 0 || x === GRID_W -1) grid[y][x] = 1; …

Excerpt — the full answer is on the round page.

▶ R78 · Crowd leaving a room by steering Open round →
```html
<!DOCTYPE html>
<html><head><title>Room Exit Simulation</title><style>canvas{border:1px solid black}</style></head><body>
<canvas id="c" width="600" height="400"></canvas>
<script>
const c=document.getElementById('c'),ctx=c.getContext('2d');
let people=[],exited=0,time=0,avgSpeed=0;
class Person{
constructor(){this.x=Math.random()*580+10;this.y=Math.random()*380+60;this.vx=0;this.vy=0;this.mass=40;this.target={x:290,y:370};this.neighbors=[]}
move(){this.x+=this.vx;this.y+=this.vy;if(this.vy<5)this.vy=1/20*(this.target.y-this.y)+.1;
else this.vy=5}
draw(){ctx.beginPath();ctx.arc(this.x,this.y,Math.sqrt(this.mass)/3,0,6.28);ctx.fill()}
}
function steer(p){
let dirY=p.target.y-p.y;return Math.min(1/20*dirY,7);
}
function collision(p,q,dx,dy,dist){
if(dist>100)return;
let nx=dx/dist,ny=dy/dist,force=4*(1-dist/100)/(p.mass+q.mass);
p.vx-=nx*force;p.vy-=ny*force;q.vx+=nx*force;q.vy+=ny …

Excerpt — the full answer is on the round page.

▶ R79 · Aggregation on a lattice Open round →
```html
<!DOCTYPE html>
<html><head><title>Diffusion-Limited Aggregation</title></head>
<body style="display:flex;justify-content:center;background:#000;margin:0">
<canvas id=c width=800 height=600 style="border:1px solid #333"></canvas>
<script>
let c=document.getElementById('c'),w=200,h=150,g=[],x,y,midX=w/2|0,midY=h/2|0,walkers=[];c.getContext('2d').scale(4,4);
function init(){
g.length=0;
for(y=0;y<h;++y)g[y]=Array(w).fill(0);
g[midY][midX]=1;
walkers=[];
let n=100;
while(n--)walkers.push({x:Math.random()*w|0,y:Math.random()*h|0,d:(Math.random()*4)|0,s:3});
}
function draw(){
const ctx=c.getContext('2d');
ctx.fillStyle='#fff';
ctx.fillRect(0,0,c.width,c.height);
ctx.fillStyle='#000';
for(y=0;y<h;++y)for(x=0;x<w;++x)if(g[y][x])ctx.fillRect(x,y,1,1);
let maxD=0;
for(y=0;y<h;++y)for(x=0;x<w;++x)if(g[y][x]){
let dx=x-midX,dy=y-midY,d=Math.sqrt(dx*dx+dy*dy);
if(d>maxD)maxD=d;
}
ctx.fillSt …

Excerpt — the full answer is on the round page.

▶ R80 · Aggregation by continuous drift Open round →
```html
<!DOCTYPE html>
<html><head><title>Particle Clustering</title></head><body style="margin:0;display:flex;justify-content:center;background:black;">
<canvas id="c"></canvas>
<script>
let c=document.getElementById("c"),ctx=c.getContext("2d")
c.width=800,c.height=800
let running=true,particles=[],seedX=400,seedY=400,stuck=0,radius=1,mass=1

function init(){
    stuck=mass=radius=1
    particles=[{x:400,y:400,attached:true}]
    for(let i=1;i<800;i++)particles.push({x:Math.random()*800,y:Math.random()*800,attached:false})
    running=true
}
function draw(){
    if(!running)return
    ctx.fillStyle="#000",ctx.fillRect(0,0,800,800)
    
    // Draw cluster
    let gradient=ctx.createRadialGradient(seedX,seedY,radius*0.9,seedX,seedY,2*radius)
    gradient.addColorStop(0,"#369"),gradient.addColorStop(1,"#135")
    ctx.fillStyle=gradient
    ctx.beginPath()
    ctx.arc(seedX,seedY,radius+m …

Excerpt — the full answer is on the round page.

▶ R81 · Flocking birds with three rules Open round →
```html
<!DOCTYPE html><html><body style="margin:0;display:flex;justify-content:center;align-items:center;height:100vh;background:#000"><canvas id="c"></canvas><div id="flockInfo" style="position:absolute;color:white;font-family:sans-serif"></div></body>
<script>
const canvas = document.getElementById('c');
const ctx = canvas.getContext('2d');
const flockInfo = document.getElementById('flockInfo');

canvas.width = 800;
canvas.height = 600;

class Bird {
    constructor() {
        this.x = Math.random() * canvas.width;
        this.y = Math.random() * canvas.height;
        this.vx = (Math.random() - 0.5) * 2;
        this.vy = (Math.random() - 0.5) * 2;
        this.fx = 0;
        this.fy = 0;
        this.id = Date.now();
    }
}

let birds = [];
const birdCount = 200;
let flockCount = 0;
let averageSpeed = 0;
let frame = 0;

function init() {
    birds.length = 0;
    for (let i = 0; …

Excerpt — the full answer is on the round page.

▶ R82 · Conway's Game of Life with seeded patterns Open round →
```html
<!DOCTYPE html><html><body style="background:#000;margin:0;display:flex;justify-content:center;align-items:center;height:100vh"><canvas id=c width=600 height=400></canvas><script>
const c=document.getElementById('c'),ctx=c.getContext('2d');let w=120,h=80,sz=5,gen=0,live=0;let grid=[],next=[];class Color{constructor(age){this.hue=(age%60)/60*360;this.alpha=Math.min(1,age/50);}}function init(){grid=new Array(w).fill().map(()=>new Array(h).fill(0));for(let y=0;y<h;y++)for(let x=0;x<w;x++){if(Math.random()<0.02||near(x,y,[[50,30],[51,30],[52,30],[51,29],[51,31]]))grid[x][y]=gen;}}function near(x,y,pattern){return pattern.some(([a,b])=>x==a&&y==b);function count(x,y){let sum=0;if(x>0&&y>0)sum+=grid[x-1][y-1];if(y>0)sum+=grid[x][y-1];if(x<w-1&&y>0)sum+=grid[x+1][y-1];if(x>0)sum+=grid[x-1][y];if(x<w-1)sum+=grid[x+1][y];if(x>0&&y<h-1)sum+=grid[x-1][y+1];if(y<h-1)sum+=grid[x][y+1];if(x<w- …

Excerpt — the full answer is on the round page.

▶ R83 · Fourier epicycles tracing a shape Open round →
```html
<!DOCTYPE html><html><body style="background:#000;display:flex;justify-content:center;align-items:center;height:100vh;margin:0"><canvas id="c"></canvas></body>
<script>
const canvas=document.getElementById('c'),ctx=canvas.getContext('2d');
function resize(){canvas.width=window.innerWidth*.8;canvas.height=window.innerHeight*.8;
ctx.translate(canvas.width/2,canvas.height/2);
}resize();window.addEventListener('resize',resize);
let time=0,phase=0,N=40,epicycles=[],targetOutline=[],center=[0,0],radius=.5*canvas.width/max(N,10),running=true;

function computeFourierCoefficients(points){
const N=points.length;
epicycles=new Array(N).fill(0);
for(let k=-N/2;k<=N/2;k++){
let sum_r=0,sum_i=0,freq=k;
for(let n=0;n<points.length;n++){
const t=n/N*2*Math.PI,
x=points[n][0],y=points[n][1];
sum_r+=x*Math.cos(-freq*t)+y*Math.sin(-freq*t);
sum_i+=-x*Math.sin(-freq*t)+y*Math.cos(-freq*t);
}
epicyc …

Excerpt — the full answer is on the round page.

▶ R84 · Voronoi cells with moving seeds Open round →
```html
<!DOCTYPE html><html><head><title>Voronoi Animation</title><style>canvas{border:1px solid #000}#i{position:absolute;top:10px;left:10px;background:#fff;padding:5px}</style></head><body>
<canvas id="c"></canvas><div id="i">Cells: 25<br>Largest Area: ...</div>
<script>
function seed(){this.x=Math.random()*w;this.y=Math.random()*h;this.vx=(Math.random()-0.5)*2;this.vy=(Math.random()-0.5)*2;}
var w=800,h=600,seeds=[],grid=[],maxArea=0,cells=25;
function init(){s.clearRect(0,0,w,h);w=c.width=h=c.height=window.innerWidth-40;h=window.innerHeight-140;c.width=w;c.height=h;s=c.getContext('2d');
for(let i=0;i<cells;i++)seeds.push(new seed());}
var c=document.getElementById('c'),s;
init();
function computeGrid(){
grid=[];for(let y=0;y<h;y++){
let row=[];for(let x=0;x<w;x++){let d=Infinity,n=-1;seeds.forEach((p,i)=>{
let dx=x-p.x,dy=y-p.y,dist=Math.sqrt(dx*dx+dy*dy);
if(dist<d){d=dist;n=i;}}); …

Excerpt — the full answer is on the round page.

▶ R85 · Travelling salesman improved by 2-opt Open round →
```html
<!DOCTYPE html>
<html><head><title>TSP 2-opt Animation</title><style>
body { background:#1a1a1a; margin:0; padding:5px }
canvas { border:1px solid white }
text { color:white; font-family:sans-serif }
</style></head><body>
<canvas id=c width=800 height=600></canvas><div id=d style="position:absolute;top:5px;left:5px;">Length: <span id=l>0</span><br>Improvements: <span id=i>0</span></div>
<script>
let c=document.getElementById('c'),ctx=c.getContext('2d'),w=800,h=600,n=60,cities=[],paths,x1=-1,y1,z1,tour=[],i=0,totalLength=0,improvements=0,running=true;
function city(x,y){this.x=x;this.y=y}
function init(){
cities=[];tour=[];totalLength=0;improvements=0;i=0;
for(let j=0;j<n;j++)cities.push(new city(Math.random()*w,Math.random()*h));
let start=cities[0];
tour=[start];
let remaining=[...cities.filter(c=>c!=start)];
while(remaining.length){
    let minDist=Infinity,next=null;
    for(l …

Excerpt — the full answer is on the round page.

▶ R86 · Scrolling terrain from value noise Open round →
```html
<!DOCTYPE html><html><head><style>canvas{margin:0;padding:0;display:block;background:#182d45}#offset{position:absolute;top:20px;left:20px;color:white;font-family:sans-serif}</style></head><body><canvas id=c></canvas><div id=offset>Offset: 0</div><script>
"use strict";const canvas=document.getElementById("c"),ctx=canvas.getContext("2d");let width,height,seed=Math.random(),octaves=3,persistence=0.5,lacunarity=2,scale=0.01,minX=0,maxX=100;function noise(n,x,y){let s=n.toString().replace(/\./g,"").length;x=x*s/1e4|0;y=y*s/1e4|0;n=Math.sin(x+x*y*73+n.length+97)*12583*x^Math.cos(y+313*y+z*n.length);return n/568+.5}function generate(){width=canvas.width=window.innerWidth;height=canvas.height=window.innerHeight;let band=[{h:0,c:"#001b4d"},{h:.1,c:"#eab74f"},{h:.2,c:"#93c14a"},{h:.4,c:"#865e44"},{h:1,c:"#ffffff"}];seed=Math.random();let scroll=0;function draw(){ctx.fillStyle="#001b4d";ctx …

Excerpt — the full answer is on the round page.

▶ R87 · Gray-Scott reaction-diffusion Open round →
```html
<!DOCTYPE html><html><head><title>Gray-Scott Simulation</title></head><body>
<canvas id="c"></canvas>
<div id="steps">0</div>
<script>
const c=document.getElementById('c'),ctx=c.getContext('2d');
let w=128,h=64,step=0,F=0.025,k=0.06;
c.width=w*2;c.height=h*2;
let bufs=[new Float32Array(w*h),new Float32Array(w*h)];
let idx=0,buf=current=>bufs[current%2];
function init(){
  const u=1,v=0;step=0;
  for(let y=0;y<h;++y)
    for(let x=0;x<w;++x){
      let i=y*w+x;
      buf(0)[i]=u;
      buf(1)[i]=v;
    }
  for(let i=0;i<20;++i){
    const x=Math.random()*w,y=Math.random()*h,idx=~~y*w+~~x;
    buf(0)[idx]-=0.5;
  }
}
function compute(src,dst){
  const f=F,k=k,du=1-6*f+k, dv=1-6*k+f;
  for(let y=0;y<h;++y)
    for(let x=0;x<w;++x){
      let i=y*w+x;
      if(x===0||x===w-1||y===0||y===h-1){
        buf(dst)[i]=0;continue;
      }
      let sumU=0,sumV=0;
      for(let dy=-1;dy<=1;+ …

Excerpt — the full answer is on the round page.

▶ R88 · L-system tree growing in wind Open round →
```html
<!DOCTYPE html><canvas id="c"></canvas><div id="i" style="position:absolute;top:10px;left:10px;color:#fff;font-family:monospace;"></div><script>
const c=document.getElementById("c"),ctx=c.getContext("2d");
let generations=0,branches=0,maxGen=5,t=0,lastTime=0;
let stack=[],rules={F:"FF+[+F-F]-[-F+F]",'+':"+",'-':'-'};
let production="F",angle=15*Math.PI/180,len=10,windOffset=0;

c.width=window.innerWidth,c.height=window.innerHeight;
ctx.lineCap='round';
let x=c.width/2,y=c.height-100,dx=0,dy=-len;save=()=>stack.push({x,y,dx,dy});restore=()=>{
let s=stack.pop();
x=s.x,y=s.y,dx=s.dx,dy=s.dy;
};

function produce(s){return s.split('').map(c=>rules[c]||c).join('');}
function drawBranch(l){
if(generations<maxGen||branches<1)ctx.beginPath(),ctx.moveTo(x,y);
switch(l){
case'F':ctx.lineTo(x+dx*l,y+dy*l);x+=dx*l;y+=dy*l;break;
case'+':save(),dx=Math.cos(angle),dy=-Math.sin(angle);break;
ca …

Excerpt — the full answer is on the round page.

▶ R89 · Marching squares on a moving fieldDNF Open round →
No usable answer reached the harness in this round.
▶ R90 · Poisson-disk sampling, Bridson's algorithm Open round →
```html
<!DOCTYPE html><html><body style="background:#1a1a1a;display:flex;justify-content:center;align-items:center;height:100vh;margin:0"><canvas id=c></canvas><script>
const c=document.getElementById('c'),w=window.innerWidth,h=window.innerHeight,radius=20,cellSize=radius*2,minDist=radius*2,grid=[],activeList=[],points=[];
let count=0;

function init(){
    c.width=w;
    c.height=h;
    grid.length=0;
    activeList.length=0;
    points.length=0;
    count=0;
}

function getIndex(x,y){
    return Math.floor(y/cellSize)+Math.floor(x/cellSize)*Math.ceil(h/cellSize);
}

function addPoint(x,y){
    const idx=getIndex(x,y);
    if(grid[idx])grid[idx].push({x:x,y:y});
    else grid[idx]=[ {x:x,y:y} ];
    activeList.push({x:x,y:y});
    points.push({x:x,y:y});
}

function isValid(x,y){
    let xMin=Math.max(0,Math.floor((x-minDist)/cellSize));
    let xMax=Math.min(Math.ceil(w/cellSize),Math …

Excerpt — the full answer is on the round page.

▶ R91 · Starfield tunnel in perspective Open round →
```html
<!DOCTYPE html><html><body style="margin:0;background:#000;display:flex;justify-content:center;align-items:center;height:100vh"><canvas id=c></canvas><script>
const c=document.getElementById('c'),ctx=c.getContext('2d');
c.width=800;c.height=450;
let stars=[],count=300,speed=1.5,frame=0;

function init(){
stars.length=0;
for(let i=0;i<count;i++){
    let x=(Math.random()-0.5)*500,y=(Math.random()-0.5)*500,z=Math.random()*1000+500;
    stars.push({x,y,z});
}
}

function update(){
stars.forEach(s=>{
s.z-=speed;
if(s.z<=0){
s.x=(Math.random()-0.5)*500;
s.y=(Math.random()-0.5)*500;
s.z=Math.random()*1000+500;
}
let d=1/(s.z+.2);
let x=s.x*d+c.width/2,y=s.y*d+c.height/2,r=.8*(1-d);
if(r>0){
ctx.fillStyle='rgb('+Math.min(255,9/r)+', '+Math.min(255,9/r)+', '+Math.min(255,9/r)+')';
ctx.beginPath();
ctx.arc(x,y,r*3,0,Math.PI*2);
ctx.fill();
}
});
}

function draw(){
ctx.fillStyle='#000';ct …

Excerpt — the full answer is on the round page.

▶ R92 · Rotating wireframe solids with depth sorting Open round →
```html
<!DOCTYPE html><html><title>Wireframe Rotation</title><style>
canvas{border:1px solid #333;background:#1a1a1a;display:block;margin:20px auto}body{background:#111;color:#fff;font-family:sans-serif}</style><canvas id=c width=640 height=480></canvas><script>
const canvas=document.getElementById('c'),ctx=canvas.getContext('2d')
let cubes=[],octa=[],edges=[],rotX=0,rotY=0,frame=0
function createCube(x,y,z){
return[
{x:x+1,y:y+1,z:z+1},
{x:x-1,y:y+1,z:z+1},
{x:x-1,y:y-1,z:z+1},
{x:x+1,y:y-1,z:z+1},
{x:x+1,y:y+1,z:z-1},
{x:x-1,y:y+1,z:z-1},
{x:x-1,y:y-1,z:z-1},
{x:x+1,y:y-1,z:z-1}
]}
function createOcta(x,y,z){
return[
{x:x,y:y+√2/2,z:z}, {x:x,y:y-√2/2,z:z},
{x:x+√2/2,y:y,z:z}, {x:x-√2/2,y:y,z:z},
{x:x,y:y,z:+√2/2},  {x:x,y:y,z:-√2/2},
{x:x+1,y:y+1,z:+1}, {x:x+1,y:y-1,z:+1},
{x:x-1,y:y+1,z:+1}, {x:x-1,y:y-1,z:+1}
]}
function rotateX(p,angle){
let c=Math.cos(angle),s=Math.sin(angle)
retu …

Excerpt — the full answer is on the round page.

▶ R93 · Rotating wireframe height field Open round →
```html
<!DOCTYPE html><html><body style="background:#000;margin:0;display:flex;flex-direction:column;align-items:center"><div id=o style="color:white;font-family:sans-serif"></div><canvas id=c width=600 height=400></canvas><script>
const c=document.getElementById('c'),ctx=c.getContext('2d'),w=600,h=400,N=20;let t=0,grid=[],rot=0;
function init(){grid=[];for(let x=-10;x<=10;x++)for(let y=-10;y<=10;y++){const s=Math.random()*0.5+0.5;grid.push({x:x,y:y,z:Math.sin(x*2+t)+Math.cos(y*2+t)+Math.sin(t/5)*1.5,s:s})}draw();}
function draw(){ctx.fillStyle='#000';ctx.fillRect(0,0,w,h);rot+=0.02;t=rot*Math.PI/6;grid.forEach(p=>{const x=p.x,y=p.y,z=p.z+Math.sin(y*2+t)*1.5;sx=(x+y)/3*50+300,sy=(-y+z)*40+200;});
let lines=[];for(let i=0;i<N-1;i++){let row=i*N,points=[];for(let j=0;j<N;j++)points.push({x:grid[row+j].sx,y:grid[row+j].sy,z:grid[row+j].z});lines.push(...[...Array(N)].map((_,k)=>({start:poi …

Excerpt — the full answer is on the round page.

▶ R94 · Raycast maze walkthrough Open round →
```html
<!DOCTYPE html><html><head><title>Auto-Moving FPS Maze</title></head><body style="margin:0;overflow:hidden"><canvas id="c"></canvas><div id="info" style="position:absolute;top:10px;left:10px;color:white;background:black;padding:5px;"></div><script>
const canvas=document.getElementById('c'),ctx=canvas.getContext('2d');
let w,h,cx=2.5,cy=2.5,angle=0,gx=0,gy=0,speed=.1,maze=[],gridSize=16,step=0;
const MAX_DIST=12,COLS=800/2,ROWS=COLS*canvas.devicePixelRatio;

function init() {
  canvas.width=800;canvas.height=450;
  maze=[];let s=gridSize;
  for(let y=0;y<s;y++) {maze[y]=[];for(let x=0;x<s;x++) maze[y][x]=(y==0||y==s-1||x==0||x==s-1)?1:Math.random()<.4?1:0;}
}

function move() {
  step++;
  if(step%50==0) {
    let dir=[[1,0],[0,-1],[-1,0],[0,1]][~~(Math.random()*4)];
    if(maze[gy+dir[1]][gx+dir[0]]===0) {gy+=dir[1];gx+=dir[0];angle=Math.atan2(dir[0],dir[1]);}
  }
  let dx=Math.c …

Excerpt — the full answer is on the round page.

▶ R95 · Shaded sphere by painter's algorithm Open round →
```html
<!DOCTYPE html><html><body style="display:flex;justify-content:center;align-items:center;height:100vh;margin:0;background:#000"><canvas id=c></canvas>
<script>
const c=document.getElementById('c'), ctx=c.getContext('2d');
c.width=600;c.height=400;
class SpherePoints{
 constructor(n){
 this.n=n;
 this.r=50;
 this.points=[];
 this.rx=0;
 this.ry=0;
 this.lx=Math.random();
 this.ly=Math.random();
 this.lz=1;
 for(let i=0;i<n;i++){
 let u=Math.random(), v=Math.random();
 let theta=2*Math.PI*u, phi=Math.acos(2*v-1);
 let x=Math.cos(theta)*Math.sin(phi), y=Math.sin(theta)*Math.sin(phi), z=Math.cos(phi);
 this.points.push({x,y,z,rx:0,ry:0});
 }
 }
 rotate(){
 this.rx+=.03;this.ry+=.04;
 for(let p of this.points){
 p.xr=(p.x*Math.cos(this.ry)-p.y*Math.sin(this.ry));
 p.yr=(p.x*Math.sin(this.ry)+p.y*Math.cos(this.ry));
 p.xr2=p.xr;
 p.yr2=(p.yr*Math.cos(this.rx)-p.z*Math.sin(this.rx));
 p …

Excerpt — the full answer is on the round page.

▶ R96 · Force-directed graph settling Open round →
```html
<!DOCTYPE html><html><body style="background:#fff;margin:0;display:flex;justify-content:center;align-items:center;height:100vh"><canvas id=c></canvas><script>
const canvas=document.getElementById('c'),ctx=canvas.getContext('2d');let nodes=[],edges=[],n=25,width=800,height=600,spring=0.03,damp=0.99,dt=0.1;function init(){nodes.length=0;for(let i=0;i<n;i++){nodes.push({x:Math.random()*width,y:Math.random()*height,vx:0,vy:0,fx:0,fy:0})}edges=[];for(let i=0;i<n;i++)for(let j=i+1;j<n;j++)if(Math.random()<0.2)edges.push([i,j])}function force(){let e=0;nodes.forEach((node)=>{node.fx=0;node.fy=0});for(let i=0;i<edges.length;i++){const u=edges[i][0],v=edges[i][1],dx=nodes[u].x-nodes[v].x,dy=nodes[u].y-nodes[v].y,len=Math.sqrt(dx*dx+dy*dy);if(len>0){const f=spring*(len-250)/len;nodes[u].fx-=f*dx;nodes[u].fy-=f*dy;nodes[v].fx+=f*dx;nodes[v].fy+=f*dy}}for(let i=0;i<n;i++)for(let j=i+1;j<n;j+ …

Excerpt — the full answer is on the round page.

▶ R97 · Circle packing without overlap Open round →
```html
<!DOCTYPE html>
<html><body style="background:#000;margin:0;display:flex;justify-content:center;align-items:center;height:100vh">
<canvas id=c width=500 height=500></canvas>
<div style="position:absolute;color:#fff;font-family:sans-serif" id=count>Count: 0</div>
<div style="position:absolute;color:#fff;font-family:sans-serif;bottom:20px" id=coverage>Coverage: 0%</div>
<script>
const c=document.getElementById('c'),ctx=c.getContext('2d'),w=c.width,h=c.height;
let circles=[],count=0,totalArea=0,running=true;

function color(r){
    return `hsl(${Math.min(360,180+4*r)},70%,${Math.min(100,50+2*r)}%)`;
}

function start(){
if(!running)return;
ctx.clearRect(0,0,w,h);
let newCircle={x:Math.random()*w,y:Math.random()*h,radius:0,growing:true,color:''};
while(newCircle.radius<30){
newCircle.radius++;
newCircle.color=color(newCircle.radius);
let overlap=false;
circles.forEach(c=>{
if(Math.hy …

Excerpt — the full answer is on the round page.

▶ R98 · Squarified treemap of changing data Open round →
```html
<!DOCTYPE html><meta charset="utf-8"><canvas id=c></canvas>
<style>body{margin:0;overflow:hidden}canvas{display:block}</style>
<script>
class Item{
constructor(area,x,y,width,height,parent=null,children=[],labeled=false){
this.area=area,this.x=x,this.y=y,this.width=width,this.height=height,this.parent=parent,this.children=children,this.labeled=labeled
}
}
let canvas=document.getElementById('c'),ctx=canvas.getContext('2d'),items=[],
frame=0,size=850,empty=40,tick=1/60;
function generate(items,n=20){
for(let i=0;i<n;i++)items.push({area:Math.random(),children:[]})
scale(items[0],size-empty,size)
}
function scale(item,width,height){
item.width=width,item.height=height
if(!item.children.length&&Math.random()>.9)split(item)
else if(item.children.length)for(let child of item.children)
child.area=Math.random()*item.area *.5+.5*item.area
item.children.forEach((c,i)=>{let s=i+1;split(item …

Excerpt — the full answer is on the round page.

▶ R99 · Three sorting algorithms racing Open round →
```html
<!DOCTYPE html><html><head><style>body{margin:0;background:#1a1a1a;color:white;font-family:sans-serif}canvas{background:#2a2a2a}div{text-align:center;padding:5px;margin-top:5px}</style></head><body>
<canvas id=c width=900 height=340></canvas><div id=d></div><script>
const c=document.getElementById('c'),ctx=c.getContext('2d'),n=60;
let a1,a2,a3,steps=0,delay=5,compareCounts=[0,0,0];
class Sorter{
constructor(arr,copy){
this.arr=arr.slice();
this.copy=copy;
this.reset()
}
reset(){
this.pos=0;
this.done=false;
this.step();
}
step(){return null;}
draw(x,y,scale,border){
ctx.fillStyle='hsl(210,100%,95%)';
let max=Math.max(...this.arr);
for(let i=0;i<n;i++){
ctx.fillRect(x+i*(c.width/(3*n)),y+scale*(max-this.arr[i]),1, scale*this.arr[i])
if(i===this.copy[0]||i===this.copy[1]) ctx.fillStyle='hsl(240,100%,50%)';
else if(i<=this.pos) ctx.fillStyle='hsl(360,100%,95%)';
else ctx.fillStyle=' …

Excerpt — the full answer is on the round page.

▶ R100 · Sankey flow with travelling particles Open round →
```html
<!DOCTYPE html><html><body style="display:flex;justify-content:center;background:#000;margin:0"><canvas id=c width=800 height=600></canvas><script>
const ctx = document.getElementById('c').getContext('2d'),sources=[[150,75],[400,75],[650,75]],targets=[[100,550],[350,550],[600,550],[850,550]],flows=[],particles=[];let total=0;
function init(){flows.length=0;particles.length=0;for(let s=0;s<sources.length;s++)for(let t=0;t<targets.length;t++){const v=Math.random()*2+1;flows.push({from:s,to:t,value:v,width:(v/3)*6})}total=flows.reduce((a,f)=>a+f.value,0);particles.length=flows.map(f=>[])}
function drawNodes(){ctx.fillStyle='#444';sources.forEach(p=>{ctx.fillRect(p[0]-25,p[1]-25,50,50)});targets.forEach(p=>{ctx.fillRect(p[0]-25,p[1]-25,50,50)})};function drawFlows(){flows.forEach((f,i)=>{const s=sources[f.from],t=targets[f.to],dx=t[0]-s[0],dy=t[1]-s[1];ctx.beginPath();ctx.moveTo(s[0] …

Excerpt — the full answer is on the round page.

▶ R101 · Langton's ant building a highway Open round →
```html
<!DOCTYPE html><html><head><style>canvas{border:1px solid #000}#steps{position:absolute;top:10px;left:10px;color:#fff}</style></head><body><div id="steps">Step 0</div><canvas id="grid"></canvas>
<script>
class LangtonsAnt{
constructor(canvas){
this.canvas=canvas
this.ctx=canvas.getContext('2d')
this.N=200
this.grid=[]
this.reset()
}

reset(){
let c=this.N
this.grid=new Array(c).fill().map(()=>new Array(c).fill(0))
for(let i=0;i<c;i++)for(let j=0;j<c;j++)this.grid[i][j]=Math.random()<.5?1:0
this.x=c/2|0
this.y=c/2|0
this.dir=Math.floor(Math.random()*4)
this.steps=0
}

step(){
let c=this.N
if(this.x<0||this.x>=c||this.y<0||this.y>=c)return false
let color=this.grid[this.y][this.x]
if(color){
this.dir=(this.dir+3)%4
this.grid[this.y][this.x]=0
}else{
this.dir=(this.dir+1)%4
this.grid[this.y][this.x]=1
}
switch(this.dir){
case 0:this.y-=1break
case 1:this.x+=1break
case 2:this.y+=1br …

Excerpt — the full answer is on the round page.

▶ R102 · Rule 110 growing line by line Open round →
```html
<!DOCTYPE html><html><head><meta charset="utf-8"><title>Rule 110</title><style>canvas{position:relative}#r{text-align:center;display:block;margin:5px}</style></head><body>
<canvas id=c width=700 height=496></canvas><div id=r>Row 0</div><script>
const c=document.getElementById('c'),ctx=c.getContext('2d');
let cols=128,cellSize=3,row=0,cells=[],maxRows=c.height;
function init(){
    cells=[new Array(cols).fill(0)];
    cells[0][Math.floor(cols/2)]=1;
}
init();
function rule110(currentRow){
    const nextRow=new Array(cols).fill(0);
    for(let i=0;i<cols;i++){
        let left=currentRow[(i-1+cols)%cols];
        let center=currentRow[i];
        let right=currentRow[(i+1)%cols];
        let state=left*4 + center*2 + right;
        nextRow[i]=state==3?1:0;
    }
    return nextRow;
}
function draw(){
    ctx.fillStyle='white';
    ctx.fillRect(0, row%maxRows, c.width,c.height/maxRo …

Excerpt — the full answer is on the round page.

▶ R103 · Wireworld with a clock and a diode Open round →
```html
<!DOCTYPE html>
<html><head><title>Wireworld Clock with Diode</title></head><body style="background:#1a1a1a;display:flex;flex-direction:column;align-items:center;padding:0;margin:0"><canvas id=c width=800 height=600 style="border:2px solid #333;background:#000"></canvas><div id=i style="position:fixed;top:10;left:10;color:#fff;font-family:monospace"></div><script>
const c=document.getElementById('c'),ctx=c.getContext('2d'),cellSize=8,width=100,height=75,states={empty:0,conductor:1,head:2,tail:3};
let cells=[],step=0,eCount=0;

function init(){
    cells=[];
    for(let y=0;y<height;y++){
        let row=[];cells.push(row);
        for(let x=0;x<width;x++){
            row[x]=states.empty;
        }
    }
    
    // Create a torus-like loop
    const loopWidth=25,loopHeight=20,startX=(width-loopWidth)/2,startY=(height-loopHeight)/2;
    for(let y=startY;y<startY+loopHeight;y++){ …

Excerpt — the full answer is on the round page.

▶ R104 · Abelian sandpile toppling Open round →
```html
<!DOCTYPE html>
<html><body style="background:#000;margin:0;display:flex;flex-direction:column;align-items:center"><canvas id=c width=601 height=601></canvas><div id=s style="color:white"></div><script>let c=document.getElementById('c'),ctx=c.getContext('2d'),w=c.width,h=w,g=Array(w).fill().map(()=>Array(h).fill(0)),x0=w/2|0,y0=h/2|0,drops=0,topples=0;g[x0][y0]=1e3;function draw(){ctx.fillStyle='#000';ctx.fillRect(0,0,w,h);for(let i=0;i<w;i++)for(let j=0;j<h;j++){let v=g[i][j]%4;if(v>0)ctx.fillStyle=`hsl(${v*90},100%,50%)`;else ctx.fillStyle='#000';ctx.fillRect(i,j,1,1)}s.textContent=`Dropped: ${drops}\nToppled: ${topples}`}function step(){let q=[];for(let i=0;i<w;i++)for(let j=0;j<h;j++)if(g[i][j]>=4)q.push([i,j]);if(!q.length){g[x0][y0]++;drops++;let n=g[x0][y0];if(n>=4){topples++;g[x0][y0]=n-4;for(let d of[[-1,0],[1,0],[0,-1],[0,1]]){let x=x0+d[0],y=y0+d[1];if(x>=0&&x<w&&y>=0& …

Excerpt — the full answer is on the round page.

▶ R105 · Brian's Brain Open round →
```html
<!DOCTYPE html><html><head><title>Brian's Brain</title></head><body><canvas id="c"></canvas><div id="stats"></div><script>
const canvas = document.getElementById('c'), ctx = canvas.getContext('2d');
let width=120,height=120,cellSize=3,sz=width*height;
let grid=[],nextGrid=[],generation=0,liveCells=0;
function init() {
    canvas.width=width*cellSize;canvas.height=height*cellSize;
    for(let i=0;i<sz;i++) grid[i]=Math.random()>0.89?1:Math.random()>0.85?2:0;
    nextGrid=grid.slice();
}
function countNeighbors(x,y) {
    let c=0;
    for(let dx=-1;dx<=1;dx++)
        for(let dy=-1;dy<=1;dy++) {
            if(dx==0&&dy==0) continue;
            let nx=(x+dx+width)%width,ny=(y+dy+height)%height;
            c+=grid[nx+ny*width]>0?1:0;
        }
    return c;
}
function update() {
    liveCells=0;generation++;
    for(let y=0;y<height;y++)
        for(let x=0;x<width;x++) { …

Excerpt — the full answer is on the round page.

▶ R106 · Truchet tiles rearranging Open round →
```html
<!DOCTYPE html><html><body style="margin:0;background:#fff;display:flex;justify-content:center;align-items:center;height:100vh"><canvas id=c></canvas><div id=i style="position:absolute;top:20px;left:20px;font-family:sans-serif"></div><script>
const c=document.getElementById('c'),ctx=c.getContext('2d'),size=500,gridSize=16,tileCount=gridSize*gridSize,crossFadeFrames=4;
let grid=[],changing=[],frame=0;

function init(){
    c.width=size;c.height=size;ctx.lineCap='round';
    grid=[];changing=[];frame=0;
    for(let y=0;y<gridSize;y++){
        grid[y]=[];changing[y]=[];
        for(let x=0;x<gridSize;x++){
            grid[y][x]={o:Math.random()>0.5,rot:Math.random()>0.5,
                r:Math.random(),g:Math.random(),b:Math.random(),
                changeFrame:-1,newR:0,newG:0,newB:0};
        }
    }
}

function createTile(x,y,o,rot,r,g,b){
    const side=size/gridSize;
    ctx …

Excerpt — the full answer is on the round page.

▶ R107 · Hilbert curve drawing itself Open round →
```html
<!DOCTYPE html><html><body style="background:#000;display:flex;justify-content:center;align-items:center;height:100vh;margin:0"><canvas id=c></canvas>
<script>let c=document.getElementById('c'),ctx=c.getContext('2d'),order=5,w=600,h=600,nPoints=0,currentStep=0,points=[];c.width=w;c.height=h;const dirs=[[1,0],[0,1],[-1,0],[0,-1]];function randomOrder(){return Math.floor(Math.random()*3)+5}function generateHilbert(order){const size=Math.pow(2,order);let x=0,y=0,dx=1,dy=0;points=[];points.push({x:x*size/size*40 +w/2 -40/ (size),y:y*size/size*40 +h/2 -40/(size)});const stack=[];for(let i=order;i>0;i--){stack.push([...dirs[3]]);stack.push([dx,dy]);}while(stack.length>0){let dir=stack.pop();if(dir==undefined)continue;if(dir[0]==1&&dir[1]==0){points.push({x:x+40/size,y:y});x++;}else if(dir[0]==0&&dir[1]==1){points.push({x:x,y:y-40/size});y--;}else if(dir[0]==-1&&dir[1]==0){points.push({ …

Excerpt — the full answer is on the round page.

▶ R108 · Interlocking star pattern on a grid Open round →
```html
<!DOCTYPE html><html><head><style>canvas{background:#fff;border:1px solid #ccc}#stats{position:absolute;top:10px;left:10px;font-family:sans-serif}</style></head><body>
<canvas id=c></canvas><div id=stats></div>
<script>
const c=document.getElementById('c'),ctx=c.getContext('2d');
let w,h,gridSize=5,strokeCount=0;
function resize(){w=window.innerWidth*.75;h=window.innerHeight*.75;c.width=w;c.height=h;};
resize();
window.addEventListener('resize',resize);

const CELL_SIZE=80,POLYGON_SIDES=6;
let angle=0;

function drawLine(x1,y1,x2,y2){
    ctx.beginPath();
    ctx.moveTo(x1,y1);
    ctx.lineTo(x2,y2);
    ctx.stroke();
}

function getPoint(cx,cy,radius,angle){
    return{ 
        x:cx+radius*Math.cos(angle),
        y:cy+radius*Math.sin(angle)
    };
}

function drawPattern(){
    const gridSize = Math.floor(w/CELL_SIZE);
    strokeCount=0;
    
    ctx.strokeStyle='#2c3e50'; …

Excerpt — the full answer is on the round page.

▶ R109 · Moire from two rotating rasters Open round →
```html
<!DOCTYPE html>
<html><body style="margin:0;display:flex;justify-content:center;background:#000;height:100vh">
<canvas id=c></canvas>
<script>
var c=document.getElementById('c'),ctx=c.getContext('2d');
c.width=500;c.height=500;
let angle=0,shiftX=0,shiftY=0,time=0,lastFrame=0,rings=[],center={x:250,y:250},numRings=30,ringSpacing=1.5,rotSpeed=0.006,shiftRadius=40;
function drawRings(ctx){
ctx.beginPath();
for(let i=0;i<numRings;i++){
let r=i*ringSpacing;
ctx.arc(center.x,center.y,r,0,2*Math.PI);
}
ctx.strokeStyle='hsla(180,50%,70%,0.5)';
ctx.lineWidth=0.3;ctx.stroke();
}
function drawRotatedRings(ctx){
ctx.save();ctx.translate(shiftX,shiftY);ctx.rotate(angle);
drawRings(ctx);
ctx.restore();
}
function animate(timestamp){
if(!lastFrame)lastFrame=timestamp;
let delta=(timestamp-lastFrame)/1e3,timeFactor=delta/0.5;
angle+=rotSpeed*delta;
shiftX=Math.sin(angle)*shiftRadius;
shiftY=Mat …

Excerpt — the full answer is on the round page.

▶ R110 · Penrose-style aperiodic tiling growing Open round →
```html
<!DOCTYPE html><html><head><title>Aperiodic Rhombus Tiling</title><style>canvas{border:1px solid #000;}#info{position:absolute;top:10px;left:10px;color:#fff;}</style></head><body>
<canvas id=c width=640 height=640></canvas><div id=info>Gen 0, Tiles 6</div>
<script>
const canvas=document.getElementById('c'),ctx=canvas.getContext('2d'),info=document.getElementById('info');
let gen=0,tiles=[{x:320,y:320,r:180,a1:-45,a2:45},{x:320,y:320,r:180,a1:45,a2:135},{x:320,y:320,r:90,a1:135,a2:225},{x:320,y:320,r:90,a1:225,a2:-45}],maxGen=6,scale=1,alpha=1;

function drawTile(x,y,r,a1,a2){
ctx.beginPath();
let p1={x:x+r*Math.cos(a1*Math.PI/180),y:y+r*Math.sin(a1*Math.PI/180)},
p2={x:x+r*Math.cos((a1+60)*Math.PI/180),y:y+r*Math.sin((a1+60)*Math.PI/180)},
p3={x:x+r*Math.cos((a1+60+a2-a1)*Math.PI/180),y:y+r*Math.sin((a1+60+a2-a1)*Math.PI/180)},
p4={x:x+r*Math.cos(a2*Math.PI/180),y:y+r*Math.sin(a2 …

Excerpt — the full answer is on the round page.

▶ R111 · Ant colony laying pheromone trails Open round →
```html
<!DOCTYPE html><meta charset="utf-8"><canvas id=c></canvas><div id=d style="position:absolute;top:10px;color:white"></div>
<script>
const canvas = document.getElementById('c'), ctx = canvas.getContext('2d');
const width = 500, height = 340;
canvas.width = width; canvas.height = height;

let ants = [], food = 0, running = true;
 const nestX=width/2,nestY=height/2,speed=.7,pheromoneStrength=10,evaporationRate=0.98,searchRadius=30,foodProbability=.005,numAnts=30;

class Ant {
constructor() {this.reset()}
reset() {this.x = nestX; this.y = nestY; this.vx=0; this.vy=0; this.searching=true}
}

for(let i=0;i<numAnts;i++) ants.push(new Ant());

let pheromones = Array.from({length:width}, ()=>Array(height).fill(0));

function update() {
    if(!running) return;
    ctx.fillStyle='#123'; ctx.fillRect(0,0,width,height);
    
    // Draw nest
    ctx.fillStyle='rgba(0,255,0,.4)';
    ctx.begi …

Excerpt — the full answer is on the round page.

▶ R112 · Physarum slime-mould network Open round →
```html
<html><canvas id=c></canvas>
<style>*{margin:0}</style>
<script>
var c=document.getElementById('c'),ctx=c.getContext('2d'),W=640,H=480,TRAIL=new Float32Array(W*H),AGENTS=[],BLUR=5,FADING=0.98,DEPOSIT=10,VISION=10,FOV=45,STEP=0,MAX_STEPS=1000,AGENT_COUNT=5000,SIZE=2;
function init(){TRAIL.fill(0);AGENTS=[];for(let i=0;i<AGENT_COUNT;i++){let x=W/2+Math.random()*10-5,y=H/2+Math.random()*10-5,d=Math.random()*Math.PI*2;AGENTS.push({x:x,y:y,d:d})}}init();
function sense(a){
let dx=Math.cos(a.d),dy=Math.sin(a.d);
let p=[{x:a.x+VISION*dx-Math.tan(FOV/2)*VISION*dy,y:a.y+VISION*dy+Math.tan(FOV/2)*VISION*dx},
{x:a.x+VISION*dx,y:a.y+VISION*dy},
{x:a.x+VISION*dx+Math.tan(FOV/2)*VISION*dy,y:a.y+VISION*dy-Math.tan(FOV/2)*VISION*dx}];
let m=[0,0,0];
for(let i=0;i<3;i++){
let u=p[i].x|0,v=p[i].y|0;if(u<0||u>=W||v<0||v>=H)m[i]=0;else m[i]=TRAIL[u+v*W];
}return p[m.indexOf(Math.max(...m))];
}
funct …

Excerpt — the full answer is on the round page.

▶ R113 · Predator and prey on a shared field Open round →
```html
<!DOCTYPE html><html><body style="background:#000;display:flex;flex-direction:column;height:100vh;margin:0;padding:0;">
<canvas id=c width=800 height=600></canvas>
<div id=pop style="color:white;font-family:sans-serif;padding:10px;">Prey: 0 Predators: 0</div><script>
class Food{constructor(x,y){this.x=x;this.y=y;this.energy=5}update(){if(this.energy<5)this.energy+=0.02}}class Prey{constructor(x,y){this.x=x;this.y=y;this.dir=Math.random()*Math.PI*2;this.energy=10;this.speed=3;this.size=8}update(foods,predators){let nearestFood=null,nearestDist=Infinity;foods.forEach(f=>{const dx=f.x-this.x,dx=f.y-this.y;let dist=Math.sqrt(dx*dx+dy*dy);if(dist<50&&dist<nearestDist){nearestFood=f;nearestDist=dist}});if(nearestFood){this.dir=Math.atan2(nearestFood.y-this.y,nearestFood.x-this.x)}this.x+=(Math.cos(this.dir)*this.speed)*(1/(1+predators.length/20));this.y+=(Math.sin(this.dir)*this.speed) …

Excerpt — the full answer is on the round page.

▶ R114 · Traffic jam from nothing Open round →
```html
<!DOCTYPE html><html><body style="background:#1a1a1a;color:#fff;text-align:center"><canvas id=c width=800 height=600></canvas><div id=speeds></div>
<script>
let canvas=c.getContext('2d'),w=800,h=600,radius=500,cars=[],nCars=100,maxSpeed=2,probDecel=0.3,ringLength=1000,space=ringLength/nCars,carWidth=2;
for(let i=0;i<nCars;i++)cars.push({x:(i+0.5)*space,speed:0,maxSpeed:maxSpeed,reactionTime:1});
function drawRing(){
canvas.beginPath();canvas.strokeStyle='#333';canvas.lineWidth=2;canvas.arc(w/2,h/2,radius,0,Math.PI*2);canvas.stroke();}
function drawCar(car){
let angle=(car.x/ringLength)*Math.PI*2;
let x=w/2+radius*Math.cos(angle),y=h/2+radius*Math.sin(angle);
let nextX=w/2+radius*Math.cos((car.x+1)/ringLength*Math.PI*2),
nextY=h/2+radius*Math.sin((car.x+1)/ringLength*Math.PI*2);
canvas.beginPath();
canvas.strokeStyle=`hsl(${(car.speed/maxSpeed)*360},50%,40%)`;
canvas.moveTo(x,y);c …

Excerpt — the full answer is on the round page.

▶ R115 · Crowd leaving through a bottleneck Open round →
```html
<!DOCTYPE html><html><body style="background:#1a1a1a;margin:0;display:flex;flex-direction:column;align-items:center"><canvas id=c width=640 height=360></canvas><div style="color:white;font-family:sans-serif">Inside: <span id=n>500</span><br>Flow rate: <span id=f>0</span>/s</div><script>
const c=document.getElementById('c'),ctx=c.getContext('2d')
const W=640,H=360,EXIT_W=100,EXIT_H=20,REFILL=500
let people=[],count=0,width=W,height=H,exitX=W/2-exitW/2,exitY=H-50,iterations=0,lastReset=0,flowRate=0

class Person{
constructor(x,y){
this.x=x;this.y=y;this.vx=0;this.vy=0
this.fx=0;this.fy=0;this.radius=10
}
update(){
let forceX=0,forceY=0
// Attraction to exit
let dx=exitX+EXIT_W/2 - this.x
let dy=exitY - this.y
forceX += dx*.5
forceY += dy*.5

// Repulsion from walls
if(this.x < this.radius){forceX += (this.radius - this.x)*.5}
if(this.y < this.radius){forceY += (this.radius - this.y …

Excerpt — the full answer is on the round page.

▶ R116 · Bresenham circles and lines, pixel by pixel Open round →
```html
<!DOCTYPE html><html><body style="background: black; margin:0;display:flex;justify-content:center;align-items:center;height:100vh"><canvas id=c width=600 height=600></canvas>
<script>
let c=document.getElementById('c'),ctx=c.getContext('2d'),w=600,h=600,ox=w/2,oy=h/2,ImageData=new ImageData(w,h),pixels=ImageData.data;
let lines=[],angle=0,pixelCount=0,steps=0,total=0,spokes=8,radius=100,inc=.05,circles=4;
function line(x1,y1,x2,y2){
let dx=Math.abs(x2-x1),dy=Math.abs(y2-y1);
if(dx==0&&dy==0)return;
let sx=x2>x1?1:-1,sy=y2>y1?1:-1,err=dx-dy;
while(1){pixels[((x1+ox)|0)+((y1+oy)|0)*w*4]=255;pixelCount++;
if(x1==x2&&y1==y2)break;
let e2=err*2;if(e2>-dy){err-=dy;x1+=sx}
if(e2<dx){err+=dx;y1+=sy}}
function circle(r){
for(let th=0;th<360;th+=45){let x=Math.round(r*Math.cos(th)),y=Math.round(r*Math.sin(th));
line(ox+x,oy+y,ox-x,oy-y)}
}
function update(){
ctx.fillStyle='rgba(0,0,0,.1)'; …

Excerpt — the full answer is on the round page.

▶ R117 · De Casteljau construction of a Bezier curve Open round →
```html
<!DOCTYPE html><html><body style="background:#f0f0f0;display:flex;flex-direction:column;height:100vh"><canvas id="c" width="600" height="400"></canvas><div style="padding:20px;background:white;text-align:center;color:black">t = <span id="t">0</span></div>
<script>
class Bezier {
  constructor(canvas) {
    this.canvas = canvas;
    this.ctx = canvas.getContext('2d');
    this.reset();
  }
  reset() {
    this.t = -1;
    this.points = [
      {x:50,y:350,vx:.1,vy:-.1},
      {x:200,y:50,vx:-.2,vy:.1},
      {x:400,y:300,vx:.1,vy:-.2},
      {x:550,y:100,vx:-.2,vy:.1}
    ];
    this.curve = [];
  }
  draw() {
    if (this.t < 0) return;
    this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);
    
    // Draw control points
    this.points.forEach((p,i)=>{
      this.ctx.beginPath();
      this.ctx.arc(p.x,p.y,5,0,Math.PI*2);
      this.ctx.fillStyle = 'black';
      thi …

Excerpt — the full answer is on the round page.

▶ R118 · Sutherland-Hodgman polygon clipping Open round →
```html
<!DOCTYPE html><html><head><title>Sutherland-Hodgman Clipping Demo</title><style>body{margin:0;padding:0;background:#1a1a1a;display:flex;justify-content:center;align-items:center;height:100vh;font-family:Arial, sans-serif;}canvas{border:2px solid #333;}#info{position:absolute;color:white;top:20px;left:20px;}</style></head><body><div id="info">Vertices:<span id="vcount">-</span> → <span id="vcount2">-</span></div><canvas width="800" height="600" id="c"></canvas><script>
const c=document.getElementById('c'),ctx=c.getContext('2d');let v=[];let edges=[[0,1],[1,2],[2,3],[3,4],[4,5],[5,6],[6,7],[7,8],[8,9],[9,0]];let w=800,h=600;

function randomPolygon(){
    for(let i=0;i<Math.floor(Math.random()*2)+9;i++)v.push({x:10+Math.random()*50,y:10+Math.random()*50,o:{}})
}

function clip(p,win){
    let p2=[];let c=p[p.length-1];
    for(let i=0;i<p.length;i++){let n=p[i];if(inWindow(n,win)) …

Excerpt — the full answer is on the round page.

▶ R119 · Floyd-Steinberg dithering a gradient Open round →
```html
<!DOCTYPE html><html><body style="background:#000;margin:0;display:flex;justify-content:center;align-items:center;height:100vh"><canvas id=c></canvas><div id=f style="position:absolute;color:white"></div><script>
const c=document.getElementById('c'),ctx=c.getContext('2d');
let w=512,h=512,time=0,paletteSize=4;
c.width=w;c.height=h;

function floydSteinberg() {
  let img=new ImageData(w,h),data=img.data,i=0,t=time;
  for(let y=0;y<h;++y)for(let x=0;x<w;++x){
    let v=(Math.sin(time*0.02+x)+1)/2*(paletteSize-1)|0;
    v+=Math.sin(time*0.03+y)*0.5;v=Math.max(0,Math.min(paletteSize-1,v));
    data[i]=data[i+1]=data[i+2]=v*255/(paletteSize-1);data[i+3]=255;
    i+=4;
  }
  
  for(let y=0;y<h;++y)for(let x=0;x<w;++x){
    let idx=y*w+x,i=idx*4,d=data[i];
    let err=d-(d|0);
    
    data[i]=(d|0)*255/(paletteSize-1); // Set to nearest color
    
    if(x+1<w){data[(idx+1)*4]+=err*.3; …

Excerpt — the full answer is on the round page.

▶ R120 · Scanline fill of a self-intersecting polygon Open round →
```html
<!DOCTYPE html><html><head><title>Scanline Polygon Fill</title>
<style>
canvas{border:1px solid #333;background:#000}#stats{color:#fff;position:absolute;left:10px;top:10px;font-family:sans-serif}
</style></head><body>
<canvas id=c></canvas><div id=stats></div>
<script>
const c=document.getElementById('c'),ctx=c.getContext('2d');
let w=window.innerWidth,h=window.innerHeight,poly;
const N_POINTS=30; // Number of points in polygon
let scanlines=0,spans=0;

class Polygon{
constructor(){
this.points=[];
for(let i=0;i<N_POINTS;++i){
let ang=Math.random()*Math.PI*2;
let r=150+80*Math.random();
let x=r*Math.cos(ang);
let y=r*Math.sin(ang);
this.points.push({
x:x,
y:y,
vx:0.005 + 0.003*Math.random()
});
}
}

update(){
for(let p of this.points){
p.x += Math.cos(p.x/20+p.v*10)*0.5;
p.y += Math.sin(p.y/20+p.v*10)*0.5;
p.v=0.005 + 0.003*Math.random();
}
}

getEdges(){
let res=[];
for(let i=0; …

Excerpt — the full answer is on the round page.

▶ R121 · A* pathfinding search across an obstacle grid Open round →
```html
<!DOCTYPE html><html><body style="margin:0;display:flex;justify-content:center;background:#000;font-family:Arial;height:100vh"><canvas id=c width=500 height=500></canvas><div style="color:#fff;padding:20px">Nodes Expanded: <span id=n>0</span><br>Path Length: <span id=p>∞</span></div><script>
var n=5,c=document.getElementById('c'),N=100,obs=.3,start={},goal={},nodes=[],path=[],queue=[];function init(){start={x:Math.floor(Math.random()*N),y:Math.floor(Math.random()*N)};goal={x:(start.x+Math.floor(Math.random()*4)+1)%N,y:(start.y+Math.floor(Math.random()*4)+1)%N};obstacles=new Array(N*N).fill().map((v,i)=>i%Math.random()>obs);nodes=new Array(N).fill().map(v=>new Array(N));path=[];queue=[];resetGrid();animateSearch()}function resetGrid(){for(let i=0;i<N;i++)for(let j=0;j<N;j++){if(i==start.x&&j==start.y||i==goal.x&&j==goal.y)nodes[i][j]={f:Infinity,g:0,parent:{x:i,y:j}};else nodes[i] …

Excerpt — the full answer is on the round page.

▶ R122 · Randomized maze generation via recursive backtracking Open round →
```html
<!DOCTYPE html><html><head><title>Maze Generation</title><style>body{display:flex;justify-content:center;align-items:center;height:100vh;margin:0;background:#1a1a1a;color:white;font-family:sans-serif}canvas{border:1px solid #333;border-radius:4px;image-rendering:pixelated}#title{text-align:center}</style></head><body><div id="title">Carved Cells: 0</div><canvas id="maze"></canvas><script>
const canvas=document.getElementById('maze'),ctx=canvas.getContext('2d');
const cols=31,rows=16,cellSize=24;
canvas.width=cols*cellSize;canvas.height=rows*cellSize;

class Cell{constructor(x,y){this.x=x,this.y=y,this.walls=[true,true,true,true];this.visited=false}}

let grid=[],stack=[],current=null,animQueue=[],carvedCount=0;

function init(){
  grid=[];for(let y=0;y<rows;++y){
    grid[y]=[];for(let x=0;x<cols;++x)grid[y][x]=new Cell(x,y)
  }
  stack=[];animQueue=[];carvedCount=0;
  current=gr …

Excerpt — the full answer is on the round page.

▶ R123 · Breadth-first flood fill spreading through a region Open round →
```html
<!DOCTYPE html><html><body style="background:#1a1a1a;color:white;display:flex;justify-content:center;align-items:center;height:100vh;margin:0"><canvas id=c></canvas><div id=s style="position:absolute;top:20px;left:20px;font-family:sans-serif"></div><script>
const c=document.getElementById('c'),ctx=c.getContext('2d'),w=500,h=400,cellSize=16;
let grid=[],queue=[],seedX,seedY,step=0,total=0,running=true;

function initGrid(){
    grid=[];total=0;step=0;
    const cols=Math.floor(w/cellSize),rows=Math.floor(h/cellSize);
    for(let y=0;y<rows;y++){
        let row=[];for(let x=0;x<cols;x++)row.push(Math.random()>0.35?1:0);
        grid.push(row);
    }
    while(1){
        seedX=Math.floor(Math.random()*cols);seedY=Math.floor(Math.random()*rows);
        if(grid[seedY][seedX]>0)break;
    }
    for(let y=0;y<grid.length;y++)for(let x=0;x<grid[y].length;x++)
        if(grid[y][x]==1) …

Excerpt — the full answer is on the round page.

▶ R124 · Dijkstra's shortest path over weighted terrain Open round →
```html
<!DOCTYPE html><html><head><title>Dijkstra Animation</title></head><body><canvas id="c" width="640" height="480"></canvas><div>Settled: <span id="settled">0</span>, Path Cost: <span id="cost">0</span></div><script>
const c=document.getElementById('c'),ctx=c.getContext('2d'),size=32,w=640,h=480,cols=w/size,rows=h/size;
let grid=[],source,target,distances=[],heap=[],settledCount=0,pathCost=0,running=false;

function initGrid(){
  grid=[];
  for(let y=0;y<rows;y++){
    let row=[];for(let x=0;x<cols;x++)row.push({x:x,y:y,cost:Math.floor(Math.random()*5)+1,neighbors:[],distance:Infinity,settlement:false,path:false});
    grid.push(row);
  }
  source={x:2,y:2};target={x:cols-3,y:rows-3};
}

function getDistance(x,y){return y*cols+x;}

function rebuildGrid(){
  for(let y=0;y<rows;y++){
    for(let x=0;x<cols;x++){
      grid[y][x].distance=Infinity;
      grid[y][x].settlement=false; …

Excerpt — the full answer is on the round page.

▶ R125 · Voronoi diagram growing by multi-source flood fill Open round →
```html
<!DOCTYPE html><html><body style="margin:0;height:100vh;display:flex;justify-content:center;align-items:center;background:#000"><canvas id="c" width=600 height=600 style="border:2px solid white"></canvas><div id="count" style="position:absolute;color:white;font-family:sans-serif;"></div><script>
"use strict";const canvas=document.getElementById("c"),ctx=canvas.getContext("2d");const gridSize=100,seedCount=Math.floor(Math.random()*50+30),dx=[-1,1,0,0],dy=[0,0,-1,1];let cellCount=0,cells=[],voronoi={};function init(){cellCount=0;voronoi={};cells=[];for(let i=0;i<gridSize;i++){cells.push([]);for(let j=0;j<gridSize;j++)cells[i][j]=undefined}const seeds=[];while(seeds.length<seedCount){const x=Math.floor(Math.random()*gridSize),y=Math.floor(Math.random()*gridSize);if(!seeds.some(s=>s.x===x&&s.y===y))seeds.push({x,y,color:`hsl(${Math.random()*360},80%,50%)`})}return seeds;};function fl …

Excerpt — the full answer is on the round page.

▶ R126 · Bubble sort sweeping bars into order Open round →
```html
<!DOCTYPE html>
<html><body style="background:#1a1a1a;margin:0;">
<canvas id=c width=800 height=400></canvas>
<script>
let ctx = c.getContext('2d'), a=[], n=80, w=800/n;
let x,y,k=0,s=1,cnt=0,done=false;

function init() {
a=[];for(let i=0;i<n;)a.push(Math.random());
requestAnimationFrame(draw);
}

function sortStep() {
if(done)return;
for(let i=0;i<4;i++) {
if(k+i>=n-s-1) {s++;k=0;if(s>=n){done=true;break};}
let j=k+i, t=a[j];
if(a[j]<a[j+1]){
ctx.fillStyle='#ff0000';
drawBar(j);drawBar(j+1);
} else {
[a[j],a[j+1]]= [a[j+1],a[j]];
cnt++;drawBar(j);drawBar(j+1);
}
k=j+1;
if(k>=n-s)break;
}}
function draw() {
ctx.fillStyle='#1a1a1a';ctx.fillRect(0,0,800,400);
sortStep();
for(let i=0;i<n;) {
let h=a[i]*350;
i<s? ctx.fillStyle='#2ecc71' : (k==i||k+1==i)? ctx.fillStyle='#e74c3c' : ctx.fillStyle='#ecf0f1';
drawBar(i);
}
ctx.fillStyle='white';ctx.font='20px Arial';ctx.fillText(`Compari …

Excerpt — the full answer is on the round page.

▶ R127 · Quicksort partitioning around glowing pivots Open round →
```html
<!DOCTYPE html><html><body style="background:#1a1a1a;display:flex;justify-content:center;align-items:center;height:100vh;margin:0"><canvas id="c" width="800" height="400"></canvas>
<script>
let ctx = document.getElementById('c').getContext('2d'), bars = Array(80).fill().map(() => Math.random()), colors = [], sortEnd, swapCount = 0;
function draw() {
    ctx.clearRect(0,0,800,400);
    ctx.font='20px monospace';
    ctx.fillStyle='#fff';
    ctx.fillText(`Swaps: ${swapCount}`,10,30);
    bars.forEach((h,i) => {
        let w = 9.5;
        x = i * w + 1;
        y = 400 - h*380;
        ctx.fillStyle=colors[i]||'#ddd';
        ctx.fillRect(x,y,w, h*380);
    });
}
function quickSort(l,r) {
    if(l >= r) return;
    let pivot = bars[r], i=l-1;
    colors[r]='#ff0000'; draw();
    for(let j=l; j<r; j++) {
        colors[j]='#ffff00';
        if(bars[j] < pivot) {
            i++; …

Excerpt — the full answer is on the round page.

▶ R128 · Merge sort weaving runs together Open round →
```html
<!DOCTYPE html>
<html><body style='background:#000;margin:0;display:flex;justify-content:center;align-items:center;height:100vh'>
<canvas id=c width=1920 height=1080></canvas>
<script>
bars=[];n=80;runLength=1;passNumber=0;
positions=[];targetPositions=[];
function init(){bars=[...Array(n)].map(_=>Math.random()*500+1);runLength=1;n=bars.length;passNumber=0;positions=targetPositions=[...Array(2*n)].map((_,i)=>({x:i*2*i>8},v:bars[i]))}
init();
function draw(){
const ctx=c.getContext('2d');
ctx.fillStyle='#000';ctx.fillRect(0,0,c.width,c.height);
ctx.fillStyle='#fff';ctx.font='30px Arial';
ctx.fillText(`Pass #${passNumber} - Run Length ${runLength}`,10,40);
bars.forEach((h,i)=>{let x=i*2+5,y=c.height-h*2-5;let w=2;ctx.fillStyle=(positions[i].x<runLength?'#00f':positions[i].x<2*runLength?'#0f0':'#fff');if(positions[i].x>=n) ctx.fillStyle='#888';ctx.fillRect(x,y,w,h*2);});
}
function …

Excerpt — the full answer is on the round page.

▶ R129 · Heap sort sifting the maximum to the back Open round →
```html
<!DOCTYPE html>
<html><head><style>body{margin:0;background:#f0f0f0;display:flex;justify-content:center;align-items:center;height:100%;min-height:100vh;font-family:sans-serif}.canvas-container{background:white;padding:20px;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.1)}.swap-count{position:absolute;top:10px;left:10px;color:#333}</style></head><body>
<canvas class="canvas-container"></canvas>
<div class="swap-count">Swaps: 0</div>
<script>
const canvas=document.querySelector('canvas'),ctx=canvas.getContext('2d');let w=80,h=640,barWidth=3,space=1;canvas.width=w*(barWidth+space)+50;canvas.height=h;
class HeapSortVisualizer{constructor(){this.data=this.generateRandom();this.n=80;this.state='heap';this.current=0;this.swaps=0;this.heapifySteps=[];this.sorting=false;this.siftIndex=-1;this.animationComplete=false}
generateRandom(){return Array.from({length:80},()=>Math.random())}dr …

Excerpt — the full answer is on the round page.

▶ R130 · Radix sort ordering by one digit at a time Open round →
```html
<!DOCTYPE html><html><body style="display:flex;flex-direction:column;align-items:center;background:#f0f0f0;font-family:sans-serif">
<h2>Radix Sort</h2>
<canvas id="c"></canvas>
<script>
const canvas=document.getElementById("c"), ctx=canvas.getContext("2d");
let bars=[], currentDigit=1, passNumber=0, sorting=true,delay=300;
const radix=10;

function initializeBars(){
    const max=Math.random()*400+50;
    bars=new Array(80).fill().map((_,i)=>({height:Math.random()*(max),x:i*13,y:bars?bars[i].y||0:0, currentDigit:0}));
    bars.sort((a,b)=>a.height-b.height);
}

function draw(){
    ctx.clearRect(0,0,canvas.width,canvas.height);
    canvas.width=window.innerWidth*.9;
    canvas.height=window.innerHeight*.75;
    const spacing=13;
    bars.forEach((bar,i)=>{
        const h=Math.min(canvas.height/2, bar.height*canvas.height/400), y=canvas.height/2 - h + (passNumber>bars.length?0:ba …

Excerpt — the full answer is on the round page.

▶ R131 · Weekday riddle from two clues Open round →
The day after tomorrow is two days before Thursday, which is Tuesday. Therefore, if the day after tomorrow is Tuesday, today must be Sunday.

**Answer:** Today is Sunday because the day after tomorrow (Tuesday) is two days before Thursday, so subtracting two days from Tuesday lands on Sunday.
▶ R132 · Fermi estimate: a lifetime of drinking water Open round →
To estimate how many liters of water an average adult drinks in a lifetime:

1. **Daily Water Intake**: Assume an average adult drinks **2 liters per day**.

2. **Annual Consumption**: 
   \[
   2\ \text{liters/day} \times 365\ \text{days/year} = 730\ \text{liters/year}
   \]

3. **Average Lifespan**: Assume an average lifespan of **80 years**.

4. **Lifetime Consumption**:
   \[
   730\ \text{liters/year} \times 80\ \text{years} = 58,\!400\ \text{liters}
   \]

5. **Rounded Figure**: Approximately **60,000 liters**.

\[\boxed{60,\!000}\]
▶ R133 · Three friends, three pets Open round →
Ana owns the parrot because she is allergic to fur, eliminating the cat and dog as options for her.

Ben cannot have a pet that flies, so he must own the cat (since Ana has the parrot), leaving Cleo with the dog.

Additionally, since the dog's owner is older than Ben, Cleo must be older than Ben. 

**Answer:** Ana owns the parrot, Ben owns the cat, and Cleo owns the dog.
▶ R134 · Smallest number from three remainders Open round →
To find the smallest positive integer that satisfies the following conditions:

1. When divided by 3, the remainder is 1.
2. When divided by 5, the remainder is 2.
3. When divided by 7, the remainder is 3.

Let's denote the number as \( x \).

### Step 1: Translate the Conditions into Congruences
- **Condition 1:**  
  \( x \equiv 1 \pmod{3} \)

- **Condition 2:**  
  \( x \equiv 2 \pmod{5} \)

- **Condition 3:**  
  \( x \equiv 3 \pmod{7} \)

### Step 2: Solve the System of Congruences

We can use the Chinese Remainder Theorem to solve this system.

1. **Find a common solution for the first two congruences:**
   
   - From Condition 1:  
     \( x = 3k + 1 \), where \( k \) is an integer.
   
   - Substitute into Condition 2:
     \[
     3k + 1 \equiv 2 \pmod{5} \\
     3k \equiv 1 \pmod{5}
     \]
     Multiply both sides by the modular inverse of 3 modulo 5 (which is 2):
     \[ …

Excerpt — the full answer is on the round page.

▶ R135 · Conditional dice probability Open round →
To determine the probability that two dice sum to **9** given that at least one die shows a **4**, follow these steps:

1. **Total Possible Outcomes:**
   - When rolling two six-sided dice, there are \(6 \times 6 = 36\) possible outcomes.

2. **Favorable Outcomes (Sum to 9):**
   - The pairs that sum to **9** are:
     \[
     (3, 6),\ (4, 5),\ (5, 4),\ (6, 3)
     \]
   - So, there are **4** favorable outcomes.

3. **Outcomes with At Least One Die Showing a 4:**
   - The pairs where at least one die is **4** are:
     \[
     (1, 4),\ (2, 4),\ (3, 4),\ (4, 1),\ (4, 2),\ (4, 3),\ (4, 4)
     \]
   - This gives us **7** possible outcomes.

4. **Intersection of Both Conditions:**
   - From the favorable outcomes that sum to **9**, only two pairs meet the condition of having at least one die showing a **4**:
     \[
     (4, 5),\ (5, 4)
     \]
   - So, there are **2** such outcomes.

5. ** …

Excerpt — the full answer is on the round page.

▶ R136 · Double pendulum tracing a chaotic path Open round →
```html
<!DOCTYPE html><html><head><title>Double Pendulum</title><style>canvas{border:1px solid black}#timer{position:absolute;left:20px;top:20px;color:white;font-family:sans-serif}</style></head><body>
<canvas id="c"></canvas><div id="timer">Time: 0s</div>
<script>
const canvas = document.getElementById('c');
const ctx = canvas.getContext('2d');
const timerDisplay = document.getElementById('timer');

canvas.width = 800;
canvas.height = 600;

let m1 = 10, m2 = 10;
let l1 = 150, l2 = 150;
let dampening = 0.995;
let gravity = 0.1;

let x1, y1, x2, y2;
let angle1, angle2, angVel1, angVel2, angAcc1, angAcc2;

let trailPoints = [];
const maxTrailLength = 50;

let startTime = Date.now();
let elapsed = 0;

function initPendulum() {
    angle1 = Math.random() * Math.PI * 2;
    angle2 = Math.random() * Math.PI * 2;
    angVel1 = 0;
    angVel2 = 0;
    angAcc1 = 0;
    angAcc2 = 0;
    x1 = canv …

Excerpt — the full answer is on the round page.

▶ R137 · Cloth mesh hanging and rippling in the wind Open round →
```html
<!DOCTYPE html><html><body style='margin:0;display:flex;justify-content:center;background:#1a1a1a'><div id="wind" style="position:absolute;top:20px;left:20px;color:white"></div><canvas id="c"></canvas>
<script>
class Cloth{
constructor(w=15,h=10,d=20){
this.w=w;this.h=h;this.d=d;
this.particles=[];this.springs=[];
for(let y=0;y<h;y++)
for(let x=0;x<w;x++){
let p={
x:x*d+10,
y:y*d+10,
vx:0,
vy:0,
pinned:y==0
};
this.particles.push(p);
}
for(let i=0;i<this.particles.length;i++){
let p=this.particles[i];
for(let dy=-1;dy<=1;dy++)
for(let dx=-1;dx<=1;dx++){
if(dx||dy){
let j=i+dx+(dy*this.w);
if(j>=0&&j<w*h&&Math.abs(dx)+Math.abs(dy)<=2){
let other=this.particles[j];
if(i<j&&!this.springs.some(s=>s.i==i&&s.j==j))
this.springs.push({i,j,rest:d*Math.sqrt(dx*dx+dy*dy)})
}
}
}
}
}
update(dt){
this.applyWind();
this.applyGravity();
this.solveConstraints();
this.particles.forEach(p=>{
if(! …

Excerpt — the full answer is on the round page.

▶ R138 · Two-source wave interference pattern Open round →
```html
<!DOCTYPE html><html><head><style>canvas{display:block;margin:0 auto;border:1px solid black;background:#000}body{background:#111;display:flex;flex-direction:column;align-items:center}</style></head><body>
<div id="distance" style="color:white;font-family:sans-serif;">Distance: 0.00</div>
<canvas id="c"></canvas>
<script>
const canvas = document.getElementById('c'), ctx = canvas.getContext('2d');
let w = 800, h = 600; canvas.width=w; canvas.height=h;
let src1={x:w/4,y:h/2}, src2={x:3*w/4,y:h/2};
let separation=0, dx=0.02;

function draw() {
    ctx.fillStyle='#000'; ctx.fillRect(0,0,w,h);
    
    // Update source positions
    let d = 10 + Math.sin(separation) * 50;
    src2.x = src1.x + d;
    separation += dx;
    
    // Calculate wave pattern
    for(let y=0;y<h;y++) {
        for(let x=0;x<w;x++) {
            // Wave from source 1
            let dx1 = x - src1.x, dy1 = y - …

Excerpt — the full answer is on the round page.

▶ R139 · Small n-body system orbiting a central star Open round →
```html
<!DOCTYPE html><html><body style="margin:0;padding:0;display:flex;"><canvas id=c></canvas>
<script>
"use strict";const canvas=document.getElementById("c"),ctx=canvas.getContext("2d");let W=window.innerWidth,H=window.innerHeight,collisionCount=0,ejectionCount=0,bodies=[];const NBODIES=7,G=1e-3,DT=.1,MAX_MASS=1e4,COLLISION_DIST=50,EJECTION_DIST=1000;
function init(){collisionCount=0,ejectionCount=0;bodies=[{x:0,y:0,vx:0,vy:0,mass:MAX_MASS*2,radius:20,color:"#ffff00",trail:[]},...Array(NBODIES-1).fill().map(()=>({x:Math.random()*8e3-4e3,y:Math.random()*8e3-4e3,vx:0,vy:0,mass:MAX_MASS*Math.random(),radius:10*Math.random()+5,color:`hsl(${Math.random()*360},100%,50%)`,trail:[]}));for(let i=1;i<NBODIES;++i){const body=bodies[i],r=Math.hypot(body.x,body.y);body.vx=-G*bodies[0].mass/(r*r)**.5*body.y/r;body.vy=G*bodies[0].mass/(r*r)**.5*body.x/r;if(Math.random()>.9)body.vx+=Math.random()*2 …

Excerpt — the full answer is on the round page.

▶ R140 · Water sloshing in a tilting container Open round →
```html
<!DOCTYPE html><html><head><style>canvas{border:1px solid #ccc;position:absolute;left:100px;top:100px}.info{position:absolute;left:20px;top:20px;color:#333}</style></head><body><div class="info">Tilt: <span id="angle"></span>°</div><canvas id="c" width=400 height=600></canvas><script>
const canvas=document.getElementById('c'),ctx=canvas.getContext('2d'),particles=[],W=canvas.width,H=canvas.height,NPARTICLES=200,S=3,C=0.1,CR=0.5,PARTICLE_SIZE=8,GRAVITY_MAGNITUDE=0.5,DAMPING=0.95,ROTATION_PERIOD=4;
let tiltAngle=0,time=0;
class Particle{constructor(x,y){this.x=x;this.y=y;this.vx=0;this.vy=0;this.fx=0;this.fy=0}
update(dt){
this.vx+=this.fx*dt;
this.vy+=this.fy*dt;
this.x+=this.vx*dt;
this.y+=this.vy*dt;
if(this.x<0||this.x>W){this.vx*=-DAMPING;this.x=Math.max(0,Math.min(W,this.x))}
if(this.y<0||this.y>H){this.vy*=-DAMPING;this.y=H}
}}

function init(){particles.length=0;
for(let i= …

Excerpt — the full answer is on the round page.

▶ R141 · Idiom-dense German into natural English Open round →
That was a wasted effort—we're stuck with our pants down, but quitting isn't an option.
▶ R142 · Register shift: casual complaint into formal Open round →
Subject: Request for Refund or Replacement of Blender  

Dear Customer Service Team,  

I am writing to formally lodge a complaint regarding the blender I recently purchased from your store. Unfortunately, the product stopped functioning properly within 48 hours of receipt and began emitting sparks during use, rendering it unusable.  

Given the circumstances, I kindly request either a full refund or the replacement of this item at the earliest opportunity. I trust that you will address this matter promptly to ensure a satisfactory resolution.  

Thank you for your attention to this issue.  

Best regards,  
[Your Name]
▶ R143 · Bureaucratic German into plain English Open round →
To access the service, you must submit the completely filled-out application on time; otherwise, you lose your entitlement.
▶ R144 · English apology into idiomatic Sie-German Open round →
Hierbei haben wir versagt, und ich mache hier keinen Hehl daraus. Aber wir werden es in Ordnung bringen, und das kostet Sie keinen Cent.
▶ R145 · False-friend minefield German into English Open round →
We may need to reschedule the current meeting; this is a sensitive topic, and I don't want to spread poison.
▶ R146 · Repair broken JSON (4 precise errors) Open round →
{
  "name": "Alex Weber",
  "age": 34,
  "email": "alex@example.com",
  "active": true,
  "tags": ["admin", "beta"],
  "signupYear": 2024,
  "address": {
    "street": "Hauptstr. 5",
    "city": "Berlin",
    "zip": "10115",
    "country": "Germany"
  }
}
▶ R147 · CSV with embedded comma to JSON array Open round →
[
  {
    "id": 1,
    "name": "Anna Berg",
    "notes": "Prefers email, not phone",
    "amount": 120.5
  },
  {
    "id": 2,
    "name": "Tom Klein",
    "notes": "Standard customer",
    "amount": 75
  },
  {
    "id": 3,
    "name": "Lena Fuchs",
    "notes": "Called twice, resolved",
    "amount": 200
  },
  {
    "id": 4,
    "name": "Max Otto",
    "notes": "VIP customer",
    "amount": 50
  }
]
▶ R148 · Table QA: sum, filter, max over order data Open round →
1. The total revenue from orders with status "shipped" is $241.47.

2. The OrderIDs for customer Mueller are 1001, 1003, and 1006.

3. The highest total value is from order ID 1005 with a value of $268.50.

**Answers:**

1. \$241.47  
2. 1001, 1003, 1006  
3. OrderID: 1005; Value: \$268.50
▶ R149 · Extract meeting invite into a fixed JSON schema Open round →
{
  "title": "Q3 Roadmap Kickoff",
  "date": "2026-08-18",
  "time": "10:30",
  "location": "Conference Room B, Berlin office (3rd floor)",
  "attendees": ["Sarah", "Tom", "Priya"]
}
▶ R150 · Diff two near-identical config blocks Open round →
- timeout: A-30 -> B-45
- debug: A-false -> B-true
- max_connections: A-100 -> B-150
▶ R151 · Binary search tree growing node by node Open round →
```html
<!DOCTYPE html>
<html><canvas id=c width=800 height=600></canvas>
<script>
class Node{
constructor(v,left=null,right=null){this.v=v;this.left=left;this.right=right;x=0;y=0}
draw(c,hl=false){
c.beginPath();c.arc(this.x,this.y,20,0,Math.PI*2);if(hl)c.strokeStyle="#ff4444";else c.strokeStyle="#333";
c.stroke();c.fillStyle="#fff";c.fillText(this.v.toString(),this.x-8,this.y+5);
}
connect(parent,c,hl=false){
c.beginPath();hl?c.strokeStyle="#ff4444":c.strokeStyle="#333";c.moveTo(parent.x,parent.y);c.lineTo(this.x,this.y);c.stroke();
}
}

let canvas=c.getContext("2d");
canvas.font="18px Arial";
let root=null,timer=0;
let nodes=0;
let target=null,searchPath=[];

function layout(n,dx=0,depth=0,left=true){
if(!n)return;
let x=700/2+dx,y=50+(depth*80);
n.x=x;n.y=y;
if(n.left)layout(n.left,(left? -1:1)*300/((depth||1)+2),depth+1,true);
if(n.right)layout(n.right,(left? 1:-1)*300/((depth||1)+2 …

Excerpt — the full answer is on the round page.

▶ R152 · Hash table with visible collision chains Open round →
```html
<!DOCTYPE html><html><body style="background:#1a1a1a;margin:0;display:flex;justify-content:center;align-items:center;height:100vh"><canvas id=c width=840 height=420></canvas>
<script>
let ctx=c.getContext('2d'),buckets=[],keysInserted=0,keyCount=0,running=true,loadFactor=0;
function init(){c.width=840;c.height=420;ctx.fillStyle='#1a1a1a';ctx.fillRect(0,0,c.width,c.height);buckets=[];for(let i=0;i<12;++i)buckets[i]=[];keysInserted=0}
function drawBucket(x,bucket){
  ctx.strokeStyle='rgb('+Math.min(bucket.length*5,255)+', '+Math.max(255-5*(bucket.length),0)+', 0)';
  let yStart=40;
  if(bucket.length>0){yStart+=10;ctx.beginPath();ctx.arc(x+30,40,30,0,Math.PI*2);ctx.stroke()}
  for(let i=0;i<bucket.length;++i){
    ctx.fillStyle='white';let y=yStart+i*(50);
    ctx.fillRect(x+20,y-10,40,20);
    if(i>0){ctx.beginPath();ctx.moveTo(x+30,y-60);ctx.lineTo(x+30,y-50);ctx.stroke()}
    ct …

Excerpt — the full answer is on the round page.

▶ R153 · Binary min-heap with bubble-up and sink-down Open round →
```html
<!DOCTYPE html>
<html><head><style>canvas{background:#1a1a1a;border:2px solid #333}body{display:flex;flex-direction:column;align-items:center;background:#000;color:#fff;font-family:sans-serif}</style></head><body>
<canvas id=c width=800 height=600></canvas>
<div>Inserts: <span id=i>0</span>, Extract-Mins: <span id=x>0</span></div>
<script>
const c=document.getElementById('c'),ctx=c.getContext('2d'),heap=[],inserts=document.getElementById('i'),extracts=document.getElementById('x');
let animQueue=[],currentNode=0,inserting=true,extracting=false;

class Node{
constructor(v){this.value=v;this.x=0;this.y=0;}

draw(){
ctx.beginPath();
ctx.arc(this.x,this.y,25,0,Math.PI*2);
ctx.fillStyle='#333';
ctx.fill();
ctx.strokeStyle='#fff';
ctx.stroke();
ctx.font='20px sans-serif';
ctx.textAlign='center';
ctx.fillText(this.value,this.x,this.y+10);
}

moveTo(x,y){
this.x=x;
this.y=y;
}
}

function …

Excerpt — the full answer is on the round page.

▶ R154 · Ring buffer with producer and consumer at different rates Open round →
```html
<!DOCTYPE html><html><head><title>Ring Buffer Animation</title><style>
body{display:flex;justify-content:center;align-items:center;height:100vh;margin:0;background:#222}
canvas{border-radius:50%;box-shadow:0 0 20px rgba(0,0,0,.5)}
#info{text-align:center;color:white;font-family:sans-serif;margin-top:20px}
</style></head><body>
<canvas id="buffer"></canvas><div id="info"></div>
<script>
const canvas=document.getElementById('buffer'),ctx=canvas.getContext('2d');
let w=window.innerWidth*.9,h=window.innerHeight*.9,r=Math.min(w*.45,h*.45);
canvas.width=w;canvas.height=h;
let slots=[],fillLevel=0,maxSlots=16,producer=0,consumer=0,animTime=0,lastFrame=0,speeds=[.05,.03],buffer=[];

function initBuffer(){
    buffer=new Array(maxSlots).fill(0);
    fillLevel=0;
    producer=Math.random()*maxSlots;
    consumer=(Math.random()+1)*maxSlots;
}

function getColor(frac){
    let r,g,b;
    if( …

Excerpt — the full answer is on the round page.

▶ R155 · Linked list with animated pointer relinking Open round →
```html
<!DOCTYPE html>
<html><body style="background:#1a1a1a;color:white;margin:0;padding:20px;display:flex;flex-direction:column;align-items:center;">
<canvas id=c width=640 height=320></canvas>
<div id=l>Length: 0</div>
<script>
let canvas=c.getContext("2d"),nodes=[],head=null,animating=false,lengthEl=document.getElementById('l'),width=canvas.canvas.width,height=canvas.canvas.height,gap=50,minX=100,minY=160,inserting=true;

class Node{
constructor(value=parseInt(Math.random()*10),x=minX,y=minY){
this.value=value;
this.next=null;
this.x=x;
this.y=y;
this.width=40;
this.height=30;
}
draw(){
canvas.fillStyle='blue';
if(nodes.includes(this)) canvas.fillStyle='blue';
else if(head===null||head!==this) canvas.fillStyle='#1a1a1a';
else canvas.fillStyle='red';
canvas.fillRect(this.x,this.y,this.width,this.height);
canvas.fillStyle='white';
canvas.font='20px Arial';
canvas.fillText(this.value,t …

Excerpt — the full answer is on the round page.

▶ R156 · Invent 3 product names + taglines for a fictional object (no superlatives) Open round →
1. SnackStay — Keeps snacks fresh and upright with ease.  
2. SealStand — Secure your snacks and keep them upright.  
3. FreshClamp — Locks in freshness, keeps your bag steady.
▶ R157 · Rewrite the same product text for two different audiences, facts unchanged Open round →
(a) Teenagers: The AquaGlow bottle is perfect for keeping your drinks chill all day long! It holds 750 ml and stays cold for a whopping 12 hours—wow! Made from BPA-free plastic, it has a built-in straw for easy sipping and comes in 4 super-stylish colors. Plus, it’s dishwasher-safe—so no worries about cleaning!

(b) Seniors: The AquaGlow bottle is a reliable choice for staying hydrated throughout the day. It holds 750 ml and keeps your beverages perfectly insulated for up to 12 hours. Made from BPA-free plastic, it features a convenient built-in straw and is available in four different colors. Best of all, it’s dishwasher-safe—making cleanup a breeze!
▶ R158 · 5 email subject lines under 50 chars, no clickbait, no ALL-CAPS Open round →
1. Winter Sale! 20% Off Jackets Nov 1-15  
2. Share Your Feedback on Our Mobile App  
3. Free Returns Now Available for 60 Days  
4. Big Savings + Free Returns This November  
5. New Store Features: Free Returns & More
▶ R159 · Micro-story: exactly 50 words (±5) with 3 mandatory elements Open round →
Clara gripped her red umbrella tightly as the train doors closed. She’d missed it by seconds. Waiting at the station, she noticed an old woman’s umbrella left behind—a vibrant red like hers. Following signs, Clara wandered toward the lighthouse, where the ocean whispered secrets and time seemed to pause. The delay was a gift, she realized, not a loss.
▶ R160 · Critique a generic slogan in 2 sentences + give 2 better alternatives Open round →
The slogan "Quality You Can Trust" is too generic and fails to emphasize the specific benefits of solar-powered charging for hikers and campers, such as reliability in remote conditions or uninterrupted power supply.  
1) "Unstoppable Power for Every Adventure."  
2) "Stay Charged, Stay Safe—Even Off the Grid."
▶ R161 · Selection sort vs shell sort racing side by side Open round →
```html
<!DOCTYPE html><html><body style="background:#1a1a1a;display:flex;justify-content:center;align-items:center;height:100vh;margin:0"><canvas id="c" width="960" height="480"></canvas><script>
const canvas=document.getElementById('c'),ctx=canvas.getContext('2d');
let arr=[],leftArr=[],rightArr=[],n=30,done=false;
function reset(){
  arr=Array.from({length:n},(v,i)=>Math.random());
  leftArr=[...arr]; rightArr=[...arr];
  SelectionSorter.reset(leftArr); ShellSorter.reset(rightArr);
}
class Sorter{
static reset(a){this.arr=a; this.pos=0; this.comparisons=0;}
}
class SelectionSorter extends Sorter{
static reset(a){
super.reset(a); this.currentMin=0;
this.sortedUntil=-1;
}
static step(){
if(this.sortedUntil>=n-2)return true;
let i=this.sortedUntil+1;
for(let j=i+1;j<n;j++){
this.comparisons++;
ctx.fillStyle=j==this.currentMin?'#ff3333':'#33cc33';
if(arr[j]<arr[this.currentMin])this.curre …

Excerpt — the full answer is on the round page.

▶ R162 · Breadth-first search flooding a random grid maze Open round →
```html
<!DOCTYPE html>
<html><head><meta charset="UTF-8"></head><body style="background:#000;margin:0;display:flex;justify-content:center;align-items:center;height:100vh"><canvas id="c" style="border:1px solid #333"></canvas><script>const C=document.getElementById('c'),Ctx=C.getContext('2d');let W=640,H=480,cols=20,rows=15,cellSize=W/cols,s=cols*rows*.25,start={x:0,y:0},goal={x:cols-1,y:rows-1},grid=[];class Grid{constructor(){this.reset()}reset(){let walls=[];for(let i=0;i<cols*rows*0.25;i++){let j=Math.floor(Math.random()*cols*rows);if(j!==start.x+start.y*cols&&j!=goal.x+goal.y*cols)walls.push(j)}this.grid=this.grid||Array(cols).fill().map(_=>Array(rows).fill());for(let y=0;y<rows;y++)for(let x=0;x<cols;x++){let i=x+y*cols;if(walls.includes(i))this.grid[x][y]={w:1,d:-2};else this.grid[x][y]={d:-1}}this.frontier=[start];this.visited=[];this.pathFound=false}}const G=new Grid();function …

Excerpt — the full answer is on the round page.

▶ R163 · Prim's algorithm growing a minimum spanning tree Open round →
```html
<!DOCTYPE html><html><head><style>canvas{border:1px solid #ccc}#stats{float:right;margin-left:20px}</style></head><body><canvas id="graph" width="600" height="400"></canvas><div id="stats"><canvas id="statCanvas" width="200" height="100"></canvas><div id="edgeCount">Added 0/25 edges</div></div>
<script>
let nodes=[],edges=[],mstNodes=[],mstEdges=[],totalWeight=0,currentStep=0;
const canvas=document.getElementById('graph'),ctx=canvas.getContext('2d');
const statCanvas=document.getElementById('statCanvas'),statCtx=statCanvas.getContext('2d');

class Node{
constructor(x,y){this.x=x,this.y=y,this.inTree=false}
}

function initializeGraph(){
nodes.length=edges.length=mstNodes.length=mstEdges.length=0;
totalWeight=currentStep=0;
for(let i=0;i<25;i++)nodes.push(new Node(Math.random()*600,Math.random()*400));
connectAll();
}

function connectAll(){
const radius=80;
for(let i=0;i<nodes.le …

Excerpt — the full answer is on the round page.

▶ R164 · Boids flocking with separation, alignment, cohesion and a predator Open round →
```html
<!DOCTYPE html>
<html><title>Boid Flocking Simulation</title><body>
<canvas id=c width=800 height=600></canvas>
<script>
const c=document.getElementById('c'),ctx=c.getContext('2d');let w=800,h=600,boids=[],predator={x:400,y:300,target:{x:400,y:300},radius:50,speed:0.5};const maxBoids=60,visionRadius=50,maxSpeed=2,separationWeight=1.5,alignmentWeight=1.2,cohesionWeight=1,predatorAvoidanceWeight=4;
class Boid{
constructor(){this.x=Math.random()*w;this.y=Math.random()*h;this.vx=(Math.random()-0.5)*maxSpeed;this.vy=(Math.random()-0.5)*maxSpeed}
update(boids,predator){let sepX=0,sepY=0,alignX=0,alignY=0,cohX=0,cohY=0,nearby=0;
for(let b of boids){
let dx=b.x-this.x,dy=b.y-this.y,d=Math.sqrt(dx*dx+dy*dy);
if(d<visionRadius&&d>1){
sepX+=dx/d;d>25?sepX-=dx/d:sepX-=(dx)/Math.pow(d,2);
sepY+=dy/d;d>25?sepY-=dy/d:sepY-=(dy)/Math.pow(d,2);
alignX+=b.vx;alignY+=b.vy;
cohX+=b.x;cohY+=b.y;nearb …

Excerpt — the full answer is on the round page.

▶ R165 · Recursive backtracker carving a maze, then solving it Open round →
```html
<!DOCTYPE html><html><body style="display:flex;justify-content:center;align-items:center;height:100vh;margin:0;background:#333"><canvas id=c></canvas><script>
const c=document.getElementById('c'),ctx=c.getContext('2d');
let cw=750,ch=480,cols=25,rows=18,cellS=cw/cols,grid=[],stack=[],current=null,totalCells=cols*rows,count=0,solving=false,wanderer=null,target=null,solvePath=[],steps=0;
c.width=cw;c.height=ch;

function Cell(i,j){
this.i=i;this.j=j;
this.walls=[1,1,1,1]; // top,right,bottom,left
this.visited=false;
return this;
}

Cell.prototype.getIndex=(i,j)=>i + j*cols;

Cell.prototype.show=(x,y)=>{
if(this.visited)ctx.fillStyle='#202020';
else ctx.fillStyle='#333';
ctx.fillRect(x+1,y+1,cellS-2,cellS-2);
if(this.walls[0])ctx.fillRect(x,y,cellS,1);
if(this.walls[1])ctx.fillRect(x+cellS-1,y,1,cellS);
if(this.walls[2])ctx.fillRect(x+1,y+cellS-1,cellS-2,1);
if(this.walls[3])ctx.fil …

Excerpt — the full answer is on the round page.

▶ R166 · Faithful 3-sentence summary of a chaotic meeting transcript Open round →
The team decided to move the weekly status update from Friday afternoon to Monday morning starting next week and adopted Priya's simplified ticket labeling system, which she will update by Wednesday. Tom was tasked with sending out an updated calendar invite reflecting the change by end of day Friday. The office plant budget discussion was pushed to the next meeting.
▶ R167 · One-sentence TL;DR under 25 words Open round →
Nova Analytics v4.2 introduces three new features but deprecates the /v1/reports API, requiring migration to /v3/reports by September 30, 2026, after which the old endpoint will stop working.
▶ R168 · Extract action items as a checklist Open round →
1. Maria -- finalize new homepage copy and send to Ben for review -- by this Thursday  
2. Ben -- review homepage copy and provide feedback -- by Friday  
3. Chen -- fix broken contact form bug -- by Monday  
4. Maria -- chase client for confirmation on new logo colors -- today  
5. Ben -- send updated privacy policy text to legal -- by next Wednesday
▶ R169 · Neutral summary of a biased product rant Open round →
The blender jug leaks liquid when filled past the halfway line, resulting in a puddle on the counter. The "10-speed" dial has speeds (4 through 7) that do not function differently from each other. The motor overheats and shuts off after about 90 seconds of continuous use.
▶ R170 · Compress a how-to into exactly 5 numbered steps Open round →
1. Day one: Mix 100g whole wheat flour with 100g room-temp water (21°C ideal) in a clean jar.  
2. Stir into paste, loosely cover, leave in warm spot for 24 hours.  
3. Discard half mixture, feed remaining with 100g flour and 100g water daily.  
4. Repeat discard-and-feed process for about 5 more days (total ~7 days).  
5. Use when it reliably doubles size within 4-6 hours of feeding, showing bubbles and tangy smell.
▶ R171 · Fireworks bursting into fading sparks Open round →
```html
<!DOCTYPE html><html><body style="margin:0;overflow:hidden;background:#000"><div id="counter" style="position:absolute;top:10;left:10;color:white"></div><canvas id="c"></canvas>
<script>
const canvas=document.getElementById('c'),ctx=canvas.getContext('2d');
let particles=[],launchX,launchY=500,width,height,activeCount=0;
function resizeCanvas(){width=window.innerWidth;height=window.innerHeight;canvas.width=width;canvas.height=height}
resizeCanvas();window.addEventListener('resize',resizeCanvas);
class Particle{
constructor(x,y,vx,vy,radius,color,alpha){
this.x=x;this.y=y;this.vx=vx;this vy=vy;this.radius=radius;this.color=color||'#fff';this.alpha=alpha||1;
this.trailLength=5;this.trail=[];this.lifetime=200;this.brightness=1;this.exploded=false
}
update(g){
if(!this.exploded){
this.vx*=0.98;this.vy+=g;
for(let i=this.trail.length-1;i>=0;i--){
this.trail[i].alpha*=0.97
}this.trail. …

Excerpt — the full answer is on the round page.

▶ R172 · Raindrops sliding down a window pane Open round →
```html
<!DOCTYPE html>
<html><head><title>Rain Simulation</title><style>canvas{position:absolute;top:0;left:0;background:#111}body{margin:0;height:100vh;display:flex;justify-content:center;align-items:center;background:#000}</style></head><body><canvas id=c></canvas>
<script>
var c=document.getElementById('c'),ctx=c.getContext('2d'),drops=[],frame=0,blurAmount=.4,minR=5,maxR=15;
function setup(){
    c.width=window.innerWidth,c.height=window.innerHeight;
    drops=[];
    for(let i=Math.random()*30+50;i--;){
        const drop={x:Math.random()*c.width,y:Math.random()*c.height,r:minR,vx:0,vy:0,age:0,color:'hsl('+Math.random()*120+',90%,40%)'};
        drops.push(drop);
    }
}
function update(){
    frame++;
    for(let i=drops.length-1;i>=0;i--){
        const drop=drops[i];
        if(drop.age<60){
            drop.r=Math.min(maxR,drop.r+Math.random()/3*frame%2==0?1:0);
        }else{ …

Excerpt — the full answer is on the round page.

▶ R173 · Metaball lava lamp with heating and cooling blobs Open round →
```html
<!DOCTYPE html><html><body style="margin:0;display:flex;justify-content:center;align-items:center;height:100vh;background:#000"><canvas id=c width=400 height=400></canvas>
<script>
let c=document.getElementById('c'),ctx=c.getContext('2d'),w=400,h=400,blobs=[],gridSize=20,threshold=.6,count=5+Math.random()*3|0;blobs.length=count
class Blob{constructor(){this.x=w/2,this.y=h/2+100*(Math.random()-0.5),this.radius=30*(Math.random()+0.5),this.dx=(Math.random()-0.5)*2,this.dy=(Math.random()-0.5)*2,this.temperature=50}update(){let t=this;if(t.y>w/2)t.temperature+=1e-3 else t.temperature-=1e-3;const a=0.1;t.radius=60*(t.temperature/100);if(t.y<w/2){t.dy=Math.min(4,t.dy+a)}else{t.dy=Math.max(-4,t.dy-a)}t.x+=t.dx;t.y+=t.dy;if(t.x<left(t.y))t.x=left(t.y),t.dx*=-.75;if(t.x>right(t.y))t.x=right(t.y),t.dx*=-.75;if(t.y<0||t.y>w)({t.dy*=-.75,t.y=Math.max(0,Math.min(w,t.y))})}draw(){}}
function le …

Excerpt — the full answer is on the round page.

▶ R174 · Recursive fractal tree growing branch by branch Open round →
```html
<!DOCTYPE html><html><body style="background:#1a1a1a;display:flex;justify-content:center;align-items:center;height:100vh;margin:0"><canvas id="c" width=800 height=600></canvas><div id="count" style="position:absolute;top:20px;color:white;font-family:sans-serif"></div>
<script>
const c=document.getElementById('c'),ctx=c.getContext('2d'),countEl=document.getElementById('count');
let counter=0,wind=0,animId,depth=Math.floor(Math.random()*3)+8;

class Branch{
constructor(x,y,angle,length,left=null,right=null){
this.x=x;this.y=y;this.angle=angle;this.length=length;
this.left=left;this.right=right;
}
}

function init(){
ctx.fillStyle='#1a1a1a';ctx.fillRect(0,0,c.width,c.height);
counter=0;wind=0;
let trunkLength=Math.random()*20+30;
let rootX=c.width/2;rootY=c.height-50;
return createBranch(rootX,rootY,-Math.PI/2,trunkLength);
}

function createBranch(x,y,angle,length){
if(depth<=0||le …

Excerpt — the full answer is on the round page.

▶ R175 · Noise flowfield painting additive particle trails Open round →
```html
<!DOCTYPE html><html><body style='margin:0;display:flex;justify-content:center;align-items:center;height:100vh;background:#000'>
<canvas id=c></canvas>
<div id=n style='position:absolute;top:20px;color:#fff;font-family:sans-serif'></div>
<script>
class Flowfield{
constructor(w=64,h=32,s=8){
this.w=w;this.h=h;this.s=s;this.seed=Math.random();this.particles=[];for(let i=0;i<Math.random()*300+300;i++)this.addParticle()}
addParticle(){
let p={
x:Math.random()*canvas.width,
y:Math.random()*canvas.height,
vx:0,
vy:0,
fx:Math.random(),
fy:Math.random()
};
this.particles.push(p)}
noise(x,y,seed){
let n= (Math.sin(x*2.34 + seed)*3 + Math.cos(y*1.56 + seed)*2) * 
       (Math.abs(Math.sin(x/3 + y/5 + seed)) ) ;
return [n, Math.atan2(n%2-1,(x+y)/10)];
}
update(t){
let ctx=canvas.getContext('2d');
ctx.fillStyle='rgba(0,0,0,.05)';
ctx.fillRect(0,0,canvas.width,canvas.height);
this.particles.f …

Excerpt — the full answer is on the round page.

▶ R176 · Fix exactly the errors, change nothing else Open round →
On Monday morning, the small archive opened its new reading room to local students. The room has six desks, two lamps, and a shelf for returned notebooks. Before the first group arrived, Mara checked the sign-in sheet and placed pencils beside each chair. She noticed that one window was stuck, but the hallway was quiet and the heater worked well. At nine o'clock, twelve students entered the archive, greeted the staff, and began comparing old town maps. Their teacher asked them to write short notes about every map they handled. One student found a drawing of the river bridge, and another matched it to a photograph from 1912. By noon, the class had labeled the boxes, cleaned the tables, and thanked Mara for her help. The visit ended on time, and the archive stayed open for regular visitors after lunch.
▶ R177 · Make the numbers consistent Open round →
Workshop attendance report:

The registration desk recorded 18 participants: 7 from North Hall, 6 from East Studio, and 5 from River Annex. The header currently says 18 participants attended.

The event ran on Wednesday, March 4, 2026, and the same paragraph later calls it Wednesday. The room booking confirmation and the posted schedule both list Wednesday, March 4, 2026.

For the feedback survey, 15 of the 18 participants submitted forms. The draft summary says this equals 83%, but 15 out of 18 is 83% when rounded to the nearest whole percent.
▶ R178 · Remove redundancy without losing facts Open round →
The neighborhood mobile clinic will open on April 8 at the Maple Community Center on Maple Street. It will offer free blood pressure checks, vaccinations, and short medical consultations. The clinic will operate every Wednesday from 10 a.m. to 4 p.m. Appointments can be booked by phone or in person. Spanish and Vietnamese interpreters will be available during clinic hours.
▶ R179 · Unify tense and perspective Open round →
At dawn, I stepped onto the station platform and checked the timetable. I noticed the last train number blinking on the board before the screen went dark. I waited beside the vending machine but kept looking toward the empty tracks. The loudspeaker crackled, and I heard a short apology for the delay. Then I walked to the ticket office, where the clerk handed over a paper voucher. I folded the voucher into my notebook and thought about the missed connection. Finally, I boarded the replacement bus and sat near the back window. As the bus left town, I watched the station lights disappear behind the rain.
▶ R180 · Fix the broken references Open round →
Maintenance note for the demo room:

The tablet is stored in the blue cabinet, and it must be charged before each session.  
The projector was tested after lunch; it should remain unplugged overnight.  

Checklist: Clean the board and wipe down surfaces.  

Setup steps:  
1. Unlock the cabinet.  
2. Place the tablet on the stand.  
3. Start the room timer.