deepseek-r1:32b
Rounds & answers 50
▶ 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 →
▶ 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 →
▶ 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 →
▶ 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.
▶ 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.