Skip to content

Commit 7f7664a

Browse files
committed
Make "SI Units" live
Closes #862
1 parent 255b432 commit 7f7664a

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

config/holes.toml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2333,16 +2333,18 @@ Shì shì shì shì.
23332333

23342334
['SI Units']
23352335
category = 'Transform'
2336-
experiment = 862
23372336
links = [
2338-
{ name = 'NIST (Units)', url = '//www.nist.gov/pml/special-publication-330/sp-330-section-2#2.3.4' },
23392337
{ name = 'NIST (Prefixes)', url = '//www.nist.gov/pml/owm/metric-si-prefixes' },
2338+
{ name = 'NIST (Units)', url = '//www.nist.gov/pml/special-publication-330/sp-330-section-2#2.3.4' },
23402339
]
23412340
synopsis = 'Express SI units using the 7 base units.'
23422341
preamble = '''
2342+
<p>
2343+
SI defines 7 base units: s, m, kg, A, K, mol, cd.
2344+
There are 22 of derived units with their own symbols defined.
2345+
These correspond to the base ones like so:
23432346
2344-
<p>SI defines 7 base units: s, m, kg, A, K, mol, cd. There are 22 of derived units with their own symbols defined. These correspond to the base ones like so:
2345-
<div class="tables-4col">
2347+
<div class=tables-4col>
23462348
<table>
23472349
<thead>
23482350
<tr>
@@ -2396,7 +2398,8 @@ preamble = '''
23962398
</div>
23972399
23982400
<p>SI further defines 24 prefixes denoting exponents of 10:
2399-
<div class="tables-4col">
2401+
2402+
<div class=tables-4col>
24002403
<table>
24012404
<thead>
24022405
<tr>
@@ -2451,12 +2454,15 @@ preamble = '''
24512454
</table>
24522455
</div>
24532456
2454-
<p>Each input comprises of a (optional) prefix and one of the base or derived units symbol,
2455-
except that symbols for decimal multiples and sub-multiples of "kg" are formed by attaching prefixes to the unit symbol "g".
2456-
For example, "10^−6 kg" is written as "mg", not as "µkg".
2457-
Each such input should be convert to product of a power of 10 and a product of base units, as described in the tables above.
2458-
If the unit is "1", only the power of ten should be printed. Furthermore, "10^1" should be printed as "10" and "10^0" as "1".<br>
2459-
For example, "MJ" should be converted to "10^6 kg m^2 s^-2".
2457+
<p>
2458+
Each input comprises of a (optional) prefix and one of the base or derived
2459+
units symbol, except that symbols for decimal multiples and sub-multiples
2460+
of "kg" are formed by attaching prefixes to the unit symbol "g". For
2461+
example, "10^−6 kg" is written as "mg", not as "µkg". Each such input
2462+
should be convert to product of a power of 10 and a product of base units,
2463+
as described in the tables above. If the unit is "1", only the power of
2464+
ten should be printed. Furthermore, "10^1" should be printed as "10" and
2465+
"10^0" as "1". For example, "MJ" should be converted to "10^6 kg m^2 s^-2".
24602466
'''
24612467

24622468
['Sierpiński Triangle']

routes/banner.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package routes
22

33
import (
44
"html/template"
5-
"strings"
65
"time"
76

87
"github.com/code-golf/code-golf/config"
@@ -17,7 +16,7 @@ type banner struct {
1716

1817
// TODO Allow a golfer to hide individual banners #709.
1918
func banners(golfer *golfer.Golfer, now time.Time) (banners []banner) {
20-
in := "in " + pretty.Time(time.Date(2023, time.April, 1, 0, 0, 0, 0, time.UTC))
19+
/* in := "in " + pretty.Time(time.Date(2023, time.April, 1, 0, 0, 0, 0, time.UTC))
2120
if strings.Contains(string(in), "ago") {
2221
in = "momentarily"
2322
}
@@ -26,7 +25,7 @@ func banners(golfer *golfer.Golfer, now time.Time) (banners []banner) {
2625
Type: "info",
2726
Body: "The <a href=/si-units>SI Units</a> hole will go live " + in +
2827
". Why not try and solve it ahead of time?",
29-
})
28+
}) */
3029

3130
// Currently all the global banners require a golfer.
3231
if golfer == nil {

sql/a-schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ CREATE TYPE hole AS ENUM (
4141
'prime-numbers-long', 'proximity-grid', 'qr-decoder', 'quine', 'recamán',
4242
'repeating-decimals', 'reverse-polish-notation',
4343
'rock-paper-scissors-spock-lizard', 'roman-to-arabic', 'rule-110',
44-
'seven-segment', 'sierpiński-triangle', 'smith-numbers',
44+
'seven-segment', 'si-units', 'sierpiński-triangle', 'smith-numbers',
4545
'spelling-numbers', 'star-wars-opening-crawl', 'sudoku', 'sudoku-v2',
4646
'ten-pin-bowling', 'time-distance', 'tongue-twisters', 'united-states',
4747
'vampire-numbers', 'van-eck-sequence', 'zodiac-signs', 'γ', 'λ', 'π', 'τ',

0 commit comments

Comments
 (0)