<!-- canonical: https://efficientnewlanguage.org/eml-p/projects/P180-power-strip/ | updated: 2026-10-19 -->

# P180 Power strip

An extension lead rated 10 A: two heaters each well under it draw 13.0 A together, and a 240 V heater on a 120 V supply gives a quarter of its heat.

EML-P project `projects/power-strip` in the EML language repo: 2 module(s), entry `main.eml`, terminal UI. There, `eml project run projects/power-strip` runs it and `eml project verify projects/power-strip` replays every session under CPython (two hash seeds) and in the interpreter; the site build replays every session in the interpreter again and publishes a session only if its screen matches.

Built on verified corpus cases: each-heater-was-within-the-rating-and-together-they-were-not (https://efficientnewlanguage.org/cases/957-each-heater-was-within-the-rating-and-together-they-were-not/), half-the-voltage-was-a-quarter-of-the-heat (https://efficientnewlanguage.org/cases/958-half-the-voltage-was-a-quarter-of-the-heat/).

## Sessions

### bad-input - interpreter: byte-equal to the golden

Input:

```text
0
x
4

4
7
4
1 1
4
1 2 3 4 5
4
x
4
1,2
4
0
4
6 5
5

5
99
5
3001
5
x
5
2000

5
2000
99
5
2000
251
5
2000
240

5
2000
240
x
5
100
250
100
6
```

Screen:

```text
== Power strip ==
An extension lead, what shares it, and a heater taken abroad.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 0
Pick a number from 1 to 6.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> x
Pick a number from 1 to 6.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 4
appliances by number, e.g. 1 4 5> 
Cancelled.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 4
appliances by number, e.g. 1 4 5> 7
Type 1 to 4 different numbers from 1 to 6, separated by spaces.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 4
appliances by number, e.g. 1 4 5> 1 1
Type 1 to 4 different numbers from 1 to 6, separated by spaces.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 4
appliances by number, e.g. 1 4 5> 1 2 3 4 5
Type 1 to 4 different numbers from 1 to 6, separated by spaces.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 4
appliances by number, e.g. 1 4 5> x
Type 1 to 4 different numbers from 1 to 6, separated by spaces.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 4
appliances by number, e.g. 1 4 5> 1,2
Type 1 to 4 different numbers from 1 to 6, separated by spaces.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 4
appliances by number, e.g. 1 4 5> 0
Type 1 to 4 different numbers from 1 to 6, separated by spaces.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 4
appliances by number, e.g. 1 4 5> 6 5
television, laptop: 175 W, 0.8 A, 8% of the rating.
Within the rating.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 5
heater watts (100 to 3000)> 
Cancelled.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 5
heater watts (100 to 3000)> 99
Type a whole number from 100 to 3000.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 5
heater watts (100 to 3000)> 3001
Type a whole number from 100 to 3000.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 5
heater watts (100 to 3000)> x
Type a whole number from 100 to 3000.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 5
heater watts (100 to 3000)> 2000
volts it was built for (100 to 250)> 
Cancelled.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 5
heater watts (100 to 3000)> 2000
volts it was built for (100 to 250)> 99
Type a whole number from 100 to 250.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 5
heater watts (100 to 3000)> 2000
volts it was built for (100 to 250)> 251
Type a whole number from 100 to 250.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 5
heater watts (100 to 3000)> 2000
volts it was built for (100 to 250)> 240
volts of the supply (100 to 250)> 
Cancelled.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 5
heater watts (100 to 3000)> 2000
volts it was built for (100 to 250)> 240
volts of the supply (100 to 250)> x
Type a whole number from 100 to 250.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 5
heater watts (100 to 3000)> 100
volts it was built for (100 to 250)> 250
volts of the supply (100 to 250)> 100
A 100 W heater built for 250 V gives 16 W on 100 V.
Less voltage, and the heat falls with its square.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 6
Bye.
```

### basic - interpreter: byte-equal to the golden

Input:

```text
1
2
3
4
1 4 5
4
1 3
4
1 2 3 4
5
2000
240
120
5
1000
120
230
5
1500
230
230
6
```

Screen:

```text
== Power strip ==
An extension lead, what shares it, and a heater taken abroad.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 1
An extension lead with 4 sockets, rated 10 A, on a 230 V supply: 2,300 W at most, for all its sockets together.
Appliances that might share it:
  1  heater         1,500 W   6.5 A
  2  second heater  1,500 W   6.5 A
  3  kettle         2,200 W   9.6 A
  4  lamp              60 W   0.3 A
  5  laptop            65 W   0.3 A
  6  television       110 W   0.5 A

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 2
Two heaters of 1,500 W: each draws 6.5 A, well under 10.
Together they draw 3,000 W, 13.0 A, on a lead rated 10 A: 130% of its rating. The rating is for the lead, not for each socket.
The heat in the lead and its plug goes with the square of the current: 1.70 times what it was built to carry.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 3
A 2,000 W heater built for 240 V is plugged into a 120 V supply with a plug adapter. Its element is a fixed resistance, 28.8 ohms.
At half the voltage it draws half the current, 8.3 A down to 4.2 A, and gives a quarter of the heat: 500 W, not 1,000.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 4
appliances by number, e.g. 1 4 5> 1 4 5
heater, lamp, laptop: 1,625 W, 7.1 A, 71% of the rating.
Within the rating.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 4
appliances by number, e.g. 1 4 5> 1 3
heater, kettle: 3,700 W, 16.1 A, 161% of the rating.
Over the rating: unplug something before the lead runs hot, at 2.59 times the heat it was built for.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 4
appliances by number, e.g. 1 4 5> 1 2 3 4
heater, second heater, kettle, lamp: 5,260 W, 22.9 A, 229% of the rating.
Over the rating: unplug something before the lead runs hot, at 5.23 times the heat it was built for.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 5
heater watts (100 to 3000)> 2000
volts it was built for (100 to 250)> 240
volts of the supply (100 to 250)> 120
A 2,000 W heater built for 240 V gives 500 W on 120 V.
Less voltage, and the heat falls with its square.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 5
heater watts (100 to 3000)> 1000
volts it was built for (100 to 250)> 120
volts of the supply (100 to 250)> 230
A 1,000 W heater built for 120 V gives 3,674 W on 230 V.
More than it was built for: the heat rises with the square of the voltage, past what the element is made to take.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 5
heater watts (100 to 3000)> 1500
volts it was built for (100 to 250)> 230
volts of the supply (100 to 250)> 230
A 1,500 W heater built for 230 V gives 1,500 W on 230 V.
The voltage it was built for.

1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit
choice> 6
Bye.
```

## Modules

### main.eml

```eml
# P180 power strip: an extension lead and what shares it - the lead, two
# heaters, a heater taken abroad, appliances of your own, and a heater of
# your own.
import power

def plain(s):
    0 => i
    len(s) => j
    while i < j and s[i] == " ":
        i + 1 => i
    while j > i and s[j - 1] == " ":
        j - 1 => j
    return s[i:j]

def pad(s, n):
    s => out
    while len(out) < n:
        out + " " => out
    return out

def lpad(s, n):
    s => out
    while len(out) < n:
        " " + out => out
    return out

def digits(t):
    for c in t:
        if c < "0" or c > "9":
            return False
    return len(t) > 0

def commas(n):
    str(n) => s
    "" => out
    0 => k
    len(s) => i
    while i > 0:
        if k == 3:
            "," + out => out
            0 => k
        s[i - 1] + out => out
        k + 1 => k
        i - 1 => i
    return out

def a1(t):
    return str(int((t - t % 10) / 10)) + "." + str(t % 10) + " A"

def hundredths(h):
    h % 100 => r
    if r < 10:
        return str(int((h - r) / 100)) + ".0" + str(r)
    return str(int((h - r) / 100)) + "." + str(r)

def show_lead():
    ("An extension lead with " + str(power.sockets()) + " sockets, rated " + str(power.rating()) + " A, on a " + str(power.supply()) + " V supply: " + commas(power.rating() * power.supply()) + " W at most, for all its sockets together.") ^0
    "Appliances that might share it:" ^0
    0 => i
    for a in power.appliances():
        ("  " + str(i + 1) + "  " + pad(a[0], 14) + lpad(commas(a[1]) + " W", 8) + lpad(a1(power.amps_tenths(a[1], power.supply())), 8)) ^0
        i + 1 => i

def load(ws):
    # [watts, tenths of an amp, percent of the rating, heat in the lead as hundredths of what it was rated for]
    0 => w
    for x in ws:
        w + x => w
    power.half_up(w * 100, power.rating() * power.supply()) => pc
    power.half_up(w * w * 100, power.supply() * power.supply() * power.rating() * power.rating()) => heat
    return [w, power.amps_tenths(w, power.supply()), pc, heat]

def show_heaters():
    power.appliances()[0][1] => w
    load([w, w]) => l
    ("Two heaters of " + commas(w) + " W: each draws " + a1(power.amps_tenths(w, power.supply())) + ", well under " + str(power.rating()) + ".") ^0
    ("Together they draw " + commas(l[0]) + " W, " + a1(l[1]) + ", on a lead rated " + str(power.rating()) + " A: " + str(l[2]) + "% of its rating. The rating is for the lead, not for each socket.") ^0
    ("The heat in the lead and its plug goes with the square of the current: " + hundredths(l[3]) + " times what it was built to carry.") ^0

def show_abroad():
    2000 => w
    240 => rated
    120 => volts
    power.half_up(rated * rated * 10, w) => ohms
    ("A " + commas(w) + " W heater built for " + str(rated) + " V is plugged into a " + str(volts) + " V supply with a plug adapter. Its element is a fixed resistance, " + str(int((ohms - ohms % 10) / 10)) + "." + str(ohms % 10) + " ohms.") ^0
    ("At half the voltage it draws half the current, " + a1(power.amps_tenths(w, rated)) + " down to " + a1(power.amps_tenths(power.watts_at(w, rated, volts), volts)) + ", and gives a quarter of the heat: " + commas(power.watts_at(w, rated, volts)) + " W, not " + commas(int(w / 2)) + ".") ^0

def own_plug():
    plain(input("appliances by number, e.g. 1 4 5> ")) => t
    if t == "":
        "Cancelled." ^0
        return
    [] => picked
    "" => cur
    True => ok
    for c in t + " ":
        if c == " ":
            if cur != "":
                if len(cur) != 1 or not digits(cur) or int(cur) < 1 or int(cur) > len(power.appliances()):
                    False => ok
                else:
                    for p in picked:
                        if p == int(cur):
                            False => ok
                    picked + [int(cur)] => picked
                "" => cur
        else:
            cur + c => cur
    if not ok or len(picked) == 0 or len(picked) > power.sockets():
        ("Type 1 to " + str(power.sockets()) + " different numbers from 1 to " + str(len(power.appliances())) + ", separated by spaces.") ^0
        return
    [] => ws
    "" => names
    for p in picked:
        power.appliances()[p - 1] => a
        ws + [a[1]] => ws
        if names != "":
            names + ", " => names
        names + a[0] => names
    load(ws) => l
    (names + ": " + commas(l[0]) + " W, " + a1(l[1]) + ", " + str(l[2]) + "% of the rating.") ^0
    if l[0] > power.rating() * power.supply():
        ("Over the rating: unplug something before the lead runs hot, at " + hundredths(l[3]) + " times the heat it was built for.") ^0
    else:
        "Within the rating." ^0

def number(prompt, lo, hi):
    plain(input(prompt + " (" + str(lo) + " to " + str(hi) + ")> ")) => t
    if t == "":
        "Cancelled." ^0
        return 0 - 1
    if len(t) > len(str(hi)) or not digits(t) or int(t) < lo or int(t) > hi:
        ("Type a whole number from " + str(lo) + " to " + str(hi) + ".") ^0
        return 0 - 1
    return int(t)

def own_heater():
    number("heater watts", 100, 3000) => w
    if w < 0:
        return
    number("volts it was built for", 100, 250) => rated
    if rated < 0:
        return
    number("volts of the supply", 100, 250) => volts
    if volts < 0:
        return
    power.watts_at(w, rated, volts) => p
    ("A " + commas(w) + " W heater built for " + str(rated) + " V gives " + commas(p) + " W on " + str(volts) + " V.") ^0
    if volts < rated:
        "Less voltage, and the heat falls with its square." ^0
    elif volts > rated:
        "More than it was built for: the heat rises with the square of the voltage, past what the element is made to take." ^0
    else:
        "The voltage it was built for." ^0

"== Power strip ==" ^0
"An extension lead, what shares it, and a heater taken abroad." ^0
True => running
while running:
    "" ^0
    "1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit" ^0
    plain(input("choice> ")) => choice
    if choice == "1":
        show_lead()
    elif choice == "2":
        show_heaters()
    elif choice == "3":
        show_abroad()
    elif choice == "4":
        own_plug()
    elif choice == "5":
        own_heater()
    elif choice == "6":
        False => running
    else:
        "Pick a number from 1 to 6." ^0
"Bye." ^0
```

Python projection of main.eml:

```python
import power

def plain(s):
    i = 0
    j = len(s)
    while i < j and s[i] == " ":
        i = i + 1
    while j > i and s[j - 1] == " ":
        j = j - 1
    return s[i:j]

def pad(s, n):
    out = s
    while len(out) < n:
        out = out + " "
    return out

def lpad(s, n):
    out = s
    while len(out) < n:
        out = " " + out
    return out

def digits(t):
    for c in t:
        if c < "0" or c > "9":
            return False
    return len(t) > 0

def commas(n):
    s = str(n)
    out = ""
    k = 0
    i = len(s)
    while i > 0:
        if k == 3:
            out = "," + out
            k = 0
        out = s[i - 1] + out
        k = k + 1
        i = i - 1
    return out

def a1(t):
    return str(int((t - t % 10) / 10)) + "." + str(t % 10) + " A"

def hundredths(h):
    r = h % 100
    if r < 10:
        return str(int((h - r) / 100)) + ".0" + str(r)
    return str(int((h - r) / 100)) + "." + str(r)

def show_lead():
    print("An extension lead with " + str(power.sockets()) + " sockets, rated " + str(power.rating()) + " A, on a " + str(power.supply()) + " V supply: " + commas(power.rating() * power.supply()) + " W at most, for all its sockets together.")
    print("Appliances that might share it:")
    i = 0
    for a in power.appliances():
        print("  " + str(i + 1) + "  " + pad(a[0], 14) + lpad(commas(a[1]) + " W", 8) + lpad(a1(power.amps_tenths(a[1], power.supply())), 8))
        i = i + 1

def load(ws):
    w = 0
    for x in ws:
        w = w + x
    pc = power.half_up(w * 100, power.rating() * power.supply())
    heat = power.half_up(w * w * 100, power.supply() * power.supply() * power.rating() * power.rating())
    return [w, power.amps_tenths(w, power.supply()), pc, heat]

def show_heaters():
    w = power.appliances()[0][1]
    l = load([w, w])
    print("Two heaters of " + commas(w) + " W: each draws " + a1(power.amps_tenths(w, power.supply())) + ", well under " + str(power.rating()) + ".")
    print("Together they draw " + commas(l[0]) + " W, " + a1(l[1]) + ", on a lead rated " + str(power.rating()) + " A: " + str(l[2]) + "% of its rating. The rating is for the lead, not for each socket.")
    print("The heat in the lead and its plug goes with the square of the current: " + hundredths(l[3]) + " times what it was built to carry.")

def show_abroad():
    w = 2000
    rated = 240
    volts = 120
    ohms = power.half_up(rated * rated * 10, w)
    print("A " + commas(w) + " W heater built for " + str(rated) + " V is plugged into a " + str(volts) + " V supply with a plug adapter. Its element is a fixed resistance, " + str(int((ohms - ohms % 10) / 10)) + "." + str(ohms % 10) + " ohms.")
    print("At half the voltage it draws half the current, " + a1(power.amps_tenths(w, rated)) + " down to " + a1(power.amps_tenths(power.watts_at(w, rated, volts), volts)) + ", and gives a quarter of the heat: " + commas(power.watts_at(w, rated, volts)) + " W, not " + commas(int(w / 2)) + ".")

def own_plug():
    t = plain(input("appliances by number, e.g. 1 4 5> "))
    if t == "":
        print("Cancelled.")
        return
    picked = []
    cur = ""
    ok = True
    for c in t + " ":
        if c == " ":
            if cur != "":
                if len(cur) != 1 or not digits(cur) or int(cur) < 1 or int(cur) > len(power.appliances()):
                    ok = False
                else:
                    for p in picked:
                        if p == int(cur):
                            ok = False
                    picked = picked + [int(cur)]
                cur = ""
        else:
            cur = cur + c
    if not ok or len(picked) == 0 or len(picked) > power.sockets():
        print("Type 1 to " + str(power.sockets()) + " different numbers from 1 to " + str(len(power.appliances())) + ", separated by spaces.")
        return
    ws = []
    names = ""
    for p in picked:
        a = power.appliances()[p - 1]
        ws = ws + [a[1]]
        if names != "":
            names = names + ", "
        names = names + a[0]
    l = load(ws)
    print(names + ": " + commas(l[0]) + " W, " + a1(l[1]) + ", " + str(l[2]) + "% of the rating.")
    if l[0] > power.rating() * power.supply():
        print("Over the rating: unplug something before the lead runs hot, at " + hundredths(l[3]) + " times the heat it was built for.")
    else:
        print("Within the rating.")

def number(prompt, lo, hi):
    t = plain(input(prompt + " (" + str(lo) + " to " + str(hi) + ")> "))
    if t == "":
        print("Cancelled.")
        return 0 - 1
    if len(t) > len(str(hi)) or not digits(t) or int(t) < lo or int(t) > hi:
        print("Type a whole number from " + str(lo) + " to " + str(hi) + ".")
        return 0 - 1
    return int(t)

def own_heater():
    w = number("heater watts", 100, 3000)
    if w < 0:
        return
    rated = number("volts it was built for", 100, 250)
    if rated < 0:
        return
    volts = number("volts of the supply", 100, 250)
    if volts < 0:
        return
    p = power.watts_at(w, rated, volts)
    print("A " + commas(w) + " W heater built for " + str(rated) + " V gives " + commas(p) + " W on " + str(volts) + " V.")
    if volts < rated:
        print("Less voltage, and the heat falls with its square.")
    elif volts > rated:
        print("More than it was built for: the heat rises with the square of the voltage, past what the element is made to take.")
    else:
        print("The voltage it was built for.")

print("== Power strip ==")
print("An extension lead, what shares it, and a heater taken abroad.")
running = True
while running:
    print("")
    print("1) the lead  2) two heaters  3) a heater abroad  4) plug in your own  5) a heater of your own  6) quit")
    choice = plain(input("choice> "))
    if choice == "1":
        show_lead()
    elif choice == "2":
        show_heaters()
    elif choice == "3":
        show_abroad()
    elif choice == "4":
        own_plug()
    elif choice == "5":
        own_heater()
    elif choice == "6":
        running = False
    else:
        print("Pick a number from 1 to 6.")
print("Bye.")
```

### power.eml

```eml
# P180 power strip - an extension lead rated 10 A on a 230 V supply, the
# appliances that might share it, and a heater taken abroad. As in the
# corpus case each-heater-was-within-the-rating-and-together-they-were-not,
# the lead's rating is for everything plugged into it at once: currents
# add. And as in half-the-voltage-was-a-quarter-of-the-heat, a heater is a
# fixed resistance, so its power goes with the square of the voltage. Currents
# are kept in tenths of an amp, rounded half-up.

def supply():
    return 230

def rating():
    # amps the lead is rated for, all sockets together
    return 10

def sockets():
    return 4

def appliances():
    # [name, watts on the 230 V supply]
    return [["heater", 1500], ["second heater", 1500], ["kettle", 2200], ["lamp", 60], ["laptop", 65], ["television", 110]]

def half_up(num, den):
    num * 2 + den => y
    return int((y - y % (2 * den)) / (2 * den))

def amps_tenths(watts, volts):
    return half_up(watts * 10, volts)

def watts_at(watts, rated, volts):
    # what a heater of `watts` at `rated` volts gives at `volts`
    return half_up(watts * volts * volts, rated * rated)
```

Python projection of power.eml:

```python
def supply():
    return 230

def rating():
    return 10

def sockets():
    return 4

def appliances():
    return [["heater", 1500], ["second heater", 1500], ["kettle", 2200], ["lamp", 60], ["laptop", 65], ["television", 110]]

def half_up(num, den):
    y = num * 2 + den
    return int((y - y % (2 * den)) / (2 * den))

def amps_tenths(watts, volts):
    return half_up(watts * 10, volts)

def watts_at(watts, rated, volts):
    return half_up(watts * volts * volts, rated * rated)
```

## README

# P180 - Power strip

An extension lead rated 10 A on a 230 V supply, the appliances that might
share it, and a heater taken abroad.

- `main.eml` - the menu, the lead, two heaters, a heater abroad,
  appliances of your own, and a heater of your own
- `power.eml` - the supply and the rating, the appliances, current in
  tenths of an amp, and a heater's power at another voltage

How each part works:

- Current is power over voltage, kept in tenths of an amp and rounded
  half-up from exact integers.
- As in the corpus case `each-heater-was-within-the-rating-and-together-they-were-not`,
  each 1,500 W heater draws 6.5 A, well under the lead's 10 A, and the two
  together draw 13.0 A, 130% of the rating: the rating is for everything
  plugged in at once. The heat in the lead goes with the square of the
  current, 1.70 times what it was built to carry.
- As in `half-the-voltage-was-a-quarter-of-the-heat`, a 2,000 W heater built
  for 240 V is a fixed resistance of 28.8 ohms: on 120 V it draws half the
  current, 4.2 A instead of 8.3, and gives a quarter of the heat, 500 W.
  On more voltage than it was built for, the heat rises with the square.

What is checked: menu choices 1 to 6; 1 to 4 different appliances by
number, separated by spaces; a heater of 100 to 3000 W and voltages of 100
to 250. An empty answer cancels.

Sessions: `sessions/basic.in` gives:
- the lead, the two heaters and the heater abroad;
- appliances of your own: a heater with a lamp and a laptop, a heater with
  the kettle, and four at once;
- heaters of your own: 2000 W for 240 V on 120 V, 1000 W for 120 V on 230
  V, and 1500 W on the voltage it was built for.

`sessions/bad-input.in` gives:
- menu choices 0 and x;
- appliances: a cancel, 7, 1 1, five numbers, x, 1,2 and 0, then 6 5;
- heaters: a cancel, 99, 3001 and x; voltages: a cancel, 99, 251, then a
  cancel and x;
- 100 W built for 250 V on 100 V.

Built on the verified corpus cases `each-heater-was-within-the-rating-and-together-they-were-not`
(two 1500 W heaters on a 10 A extension lead) and
`half-the-voltage-was-a-quarter-of-the-heat` (a 240 V heater on a 120 V
supply).
