Race and sprint · live-coded

Incantation Sprint

Tiny puzzles drop one after another: reverse every word, sum the runes, read the old numerals. Answer each by writing solve(x), in Python or JavaScript, and the first passing answer scores. The puzzles you have not answered pile up, faster as the match goes on, and with eight waiting you are out.

Head to head, or up to eight in one match, against other players or Xher's bots. The sprinters in the Hall →

How a sprint is run

  1. The puzzles. A puzzle drops at once, and another after 45 seconds, then each a little sooner than the last, down to one every 22 seconds. Everyone in the match gets the same puzzles at the same moment.
  2. Answering. Write solve(x), in Python or JavaScript, and send it. Xher runs it on the puzzle's trials, the two examples shown with it and a few hidden ones; it passes when every answer is right. A wrong answer costs nothing but time, and you are told which trial it failed.
  3. Points. The first to pass a puzzle scores 3 points; everyone who passes it after scores 1.
  4. The pile. Each puzzle waits on your pile until you pass it, and you may take them in any order. When a puzzle drops with seven already waiting, that makes eight, and you are out; your points stand.
  5. Winning. The most points when time runs out, or when everyone is out. Points tied, the one who lasted longer goes ahead, then the one with more firsts.

Open a match

Playing is part of Learn, for Reader and Downloader members. Anyone may watch matches below.

See memberships

Gathering now

No sprint is gathering. Open one and others can join from here, or race Xher's bots at once.

The highest scores

  1. Xytharian12 points

Every finished match counts, against players or bots: one line for each player's best.

Recent matches

The puzzles

Every puzzle is one of these kinds, its details drawn fresh for each match. The first rank comes early; the third more often as the match goes on. Each names a lesson that teaches what it needs.

1 Reverse every word

x is a line of words, each separated from the next by one space. Return the line with the letters of each word reversed, the words still in their order and still separated by one space.

Learn it: Python lesson 52 · JavaScript lesson 65

1 Sum the runes

x is a string of letters with digits hidden among them. Return the sum of the digits, as a number (0 if there are none).

Learn it: Python lesson 49 · JavaScript lesson 23

1 Count the open runes

x is a string of lowercase words. Return how many of its letters are vowels (a, e, i, o or u).

Learn it: Python lesson 25 · JavaScript lesson 23

1 The longest word

x is a line of words separated by single spaces. Return its longest word; if several are equally long, the first of them.

Learn it: Python lesson 51 · JavaScript lesson 65

1 Crown every word

x is a line of lowercase words separated by single spaces. Return it with the first letter of each word made a capital.

Learn it: Python lesson 52 · JavaScript lesson 11

1 Sum the even offerings

x is a list of whole numbers. Return the sum of the even ones (0 if there are none). Negative numbers can be even too.

Learn it: Python lesson 37 · JavaScript lesson 37

1 Echo every letter

x is a string. Return it with every character written twice in a row.

Learn it: Python lesson 25 · JavaScript lesson 41

1 Count the summons

x is a line of lowercase words separated by single spaces. Return how many of its words are exactly "iron".

Learn it: Python lesson 64 · JavaScript lesson 61

1 The initials

x is a line of lowercase words separated by single spaces. Return the first letter of each word, as capitals, joined together.

Learn it: Python lesson 52 · JavaScript lesson 65

1 The product of the digits

x is a whole number, 0 or more. Return the product of its digits (the product of 7 is 7; of 305, 0).

Learn it: Python lesson 21 · JavaScript lesson 25

2 The shifting cipher

x is a string of lowercase letters and spaces. Return it with every letter moved 5 places on in the alphabet, wrapping past z back to a; spaces stay as they are.

Learn it: Python lesson 53 · JavaScript lesson 11

2 The mirror cipher

x is a string of lowercase letters and spaces. Return it with every letter mirrored in the alphabet (a becomes z, b becomes y, ... z becomes a); spaces stay as they are.

Learn it: Python lesson 54 · JavaScript lesson 11

2 The mirror word

x is a string of lowercase letters and spaces. Return true (True in Python) if its letters read the same backwards as forwards once the spaces are left out, and false otherwise.

Learn it: Python lesson 31 · JavaScript lesson 11

2 Turn the wheel

x is a list. Return a new list with its items moved 2 places to the left, the ones that fall off the front joining the back in order. (Turning by more than the length goes round again; an empty list stays empty.)

Learn it: Python lesson 31 · JavaScript lesson 55

2 The running tally

x is a list of whole numbers. Return a list as long as x, where each item is the sum of x's items up to and including that place.

Learn it: Python lesson 37 · JavaScript lesson 23

2 Tally the letters

x is a string. Return a dictionary (an object in JavaScript) from each letter in it to how many times it appears. Leave out anything that is not a letter.

Learn it: Python lesson 63 · JavaScript lesson 61

2 Once of each

x is a list. Return a new list of its items with every repeat left out, each kept where it first appeared.

Learn it: Python lesson 84 · JavaScript lesson 63

2 The second-greatest

x is a list of whole numbers. Return the second-greatest different number in it, or None (null in JavaScript) if there are fewer than two different numbers.

Learn it: Python lesson 55 · JavaScript lesson 53

2 The heart of the word

x is a word of one letter or more. Return its middle letter if its length is odd, or its middle two letters if its length is even.

Learn it: Python lesson 31 · JavaScript lesson 11

2 Bind the runs

x is a string of lowercase letters. Return it with each run of the same letter written as the letter followed by how long the run is: "aaabcc" becomes "a3b1c2".

Learn it: Python lesson 50 · JavaScript lesson 23

2 The root of the number

x is a whole number, 0 or more. Add up its digits, then the digits of that, and so on until a single digit is left; return that digit.

Learn it: Python lesson 21 · JavaScript lesson 25

3 Unbind the runs

x is a string of letters, each followed by a count of one or more digits: "a3b1c12". Return the string it stands for, each letter written as many times as its count says.

Learn it: Python lesson 49 · JavaScript lesson 41

3 Read the old numerals

x is a number written in Roman numerals (I 1, V 5, X 10, L 50, C 100, D 500, M 1000), in the usual way, so a smaller numeral before a greater one is taken away: IV is 4. Return the number.

Learn it: Python lesson 61 · JavaScript lesson 33

3 The sealed wards

x is a string of brackets: ( ) [ ] { }. Return true (True in Python) if every one is closed by its own kind, in the right order, and false otherwise. An empty string is sealed.

Learn it: Python lesson 29 · JavaScript lesson 20

3 Order the shelf

x is a line of lowercase words separated by single spaces. Return a list of its words sorted from shortest to longest; words of the same length in alphabetical order.

Learn it: Python lesson 73 · JavaScript lesson 53

3 Unfold the reliquary

x is a list whose items are numbers or further lists, nested to any depth. Return one flat list of all the numbers, in the order they are met.

Learn it: Python lesson 76 · JavaScript lesson 101

3 The loudest letter

x is a string with at least one letter in it. Return the letter that appears most often (ignore anything that is not a letter); if several tie, the one first in the alphabet.

Learn it: Python lesson 63 · JavaScript lesson 61

3 The paired offerings

x is a list of whole numbers. Return how many pairs of different places in it hold numbers that add up to 9. (Each pair of places counts once.)

Learn it: Python lesson 47 · JavaScript lesson 41