Below you will find a set of texts used on TypeRacer. Certain texts only appear on certain difficulties.
Rank |
ID |
Text |
Length |
Races |
Difficulty Rating |
Top Score |
Top 100 |
Average |
Active Since |
1. |
#0 |
This is a placeholder text. You are seeing it because there are no other texts available for your skill level. Please tell your system administrator to add some texts! |
167 |
596 |
1.278 |
195.88 — Sean Wrona (arenasnow2) |
157.98 |
104.61 |
May 18, 2010 |
2. |
#10009 |
input("\n\nPress the enter key to exit.") # waits for the user to press the Enter key |
85 |
8,399 |
1.198 |
197.14 — realboot (sahibprime) |
145.65 |
65.67 |
September 15, 2012 |
3. |
#10019 |
import string from random import * characters = string.ascii_letters + string.punctuation + string.digits password = "".join(choice(characters) for x in range(randint(8, 16))) print password |
190 |
6,698 |
1.181 |
186.34 — john (johnlad) |
132.55 |
60.12 |
October 3, 2018 |
4. |
#10017 |
import random min = 1 max = 6 roll_again = "yes" while roll_again == "yes" or roll_again == "y": print "Rolling the dices..." print "The values are...." print random.randint(min, max) print random.randint(min, max) roll_again = raw_input("Roll the dices again?") |
272 |
5,750 |
1.138 |
180.73 — josugamer (ttmm22) |
114.31 |
54.98 |
October 3, 2018 |
5. |
#10018 |
import random n = random.randint(1, 99) guess = int(raw_input("Enter an integer from 1 to 99: ")) while n != "guess": print if guess < n: print "guess is low" guess = int(raw_input("Enter an integer from 1 to 99: ")) elif guess > n: print "guess is high" guess = int(raw_input("Enter an integer from 1 to 99: ")) else: print "you guessed it!" break print |
388 |
6,022 |
1.107 |
172.45 — john (johnlad) |
122.32 |
59.33 |
October 3, 2018 |
6. |
#10020 |
import urllib2 import json screen_name = "wordpress" url = "http://api.twitter.com/1/statuses/user_timeline.json?screen_name=" + screen_name data = json.load(urllib2.urlopen(url)) print len(data), "tweets" for tweet in data: print tweet['text'] |
246 |
5,228 |
1.062 |
137.02 — (sidd_) |
101.14 |
49.32 |
October 3, 2018 |
7. |
#10010 |
public class HelloWorld { public static void main(String[] args) { String message = "Hello World!!!"; System.out.println(message); } } |
143 |
6,047 |
1.060 |
134.85 — leonidas (awsomaw) |
106.61 |
49.89 |
December 29, 2017 |
8. |
#10006 |
print "Using URL", url req = urllib2.Request(url) fd = urllib2.urlopen(req) while 1: data = fd.read(1024) if not len(data): break sys.stdout.write(data) |
152 |
8,175 |
1.052 |
145.88 — (poke1) |
109.62 |
50.01 |
November 19, 2009 |
9. |
#10002 |
import os import sys def run(program, *args): pid = os.fork() if not pid: os.execvp(program, program + args) return os.wait()[0] run("python", "hello.py") |
154 |
8,407 |
1.047 |
391.77 — Drago (ldragol) |
111.39 |
48.93 |
December 5, 2009 |
10. |
#10001 |
/** Loop waiting for a connection and a valid command */ while (true) { Socket socket = null; InputStream stream = null; try { socket = serverSocket.accept(); socket.setSoTimeout(10 * 1000); stream = socket.getInputStream(); } catch (AccessControlException ace) { log.warn("StandardServer.accept security exception: " + ace.getMessage(), ace); continue; } catch (IOException e) { log.error("StandardServer.await: accept: ", e); System.exit(1); } |
445 |
5,943 |
1.045 |
449.91 — Drago (ldragol) |
105.56 |
50.46 |
December 13, 2009 |
11. |
#10015 |
function calculateArea(width, height) { try { var area = width * height; if (!isNaN(area)) { return area; } else { throw new Error('calculateArea() received invalid number'); } } catch(e) { console.log(e.name + ' ' + e.message); return 'We were unable to calculate the area.'; } } |
301 |
5,378 |
1.037 |
179.06 — Joshua (alph198) |
102.19 |
48.21 |
October 4, 2018 |
12. |
#10025 |
cmake_minimum_required(VERSION 3.10) project(Tutorial VERSION 1.0) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED True) # configure a header file to pass some of the CMake settings to the source code configure_file(TutorialConfig.h.in TutorialConfig.h) add_executable(Tutorial tutorial.cxx) # add the binary tree to the search path for include files so that we will find TutorialConfig.h target_include_directories(Tutorial PUBLIC "${PROJECT_BINARY_DIR}") |
467 |
426 |
1.006 |
119.34 — Silviu LorenČ› (smilorent) |
79.23 |
63.58 |
December 6, 2023 |
13. |
#10000 |
/* Read a set of characters from the socket */ StringBuffer command = new StringBuffer(); int expected = 1024; /* Cut off to avoid DoS attack */ while (expected < shutdown.length()) { if (random == null) random = new Random(System.currentTimeMillis()); expected += (random.nextInt() % 1024); } while (expected > 0) { int ch = -1; try { ch = stream.read(); } catch (IOException e) { log.warn("StandardServer.await: read: ", e); ch = -1; } if (ch < 32) /* Control character or EOF terminates loop break; command.append((char) ch); expected--; } |
542 |
4,914 |
1.004 |
124.87 — chillin (slekap) |
96.61 |
48.16 |
December 19, 2009 |
14. |
#10005 |
class URLLister(SGMLParser): def reset(self): SGMLParser.reset(self) self.urls = [] def start_a(self, attrs): href = [v for k, v in attrs if k=='href'] if href: self.urls.extend(href) |
183 |
7,254 |
0.985 |
417.65 — Drago (ldragol) |
105.89 |
46.37 |
November 19, 2009 |
15. |
#10022 |
import std; int main() { std::println("Hello World!"); } |
56 |
2,904 |
0.981 |
128.38 — Leon (leonsilicon) |
80.28 |
41.71 |
November 20, 2023 |
16. |
#10016 |
import re import sys import urllib2 import BeautifulSoup usage = "Run the script: ./geolocate.py IPAddress" if len(sys.argv)!=2: print(usage) sys.exit(0) if len(sys.argv) > 1: ipaddr = sys.argv[1] geody = "http://www.geody.com/geoip.php?ip=" + ipaddr html_page = urllib2.urlopen(geody).read() soup = BeautifulSoup.BeautifulSoup(html_page) |
344 |
4,688 |
0.980 |
197.76 — Ahmed Sabry (ahmedsabry) |
94.05 |
44.34 |
October 3, 2018 |
17. |
#10021 |
import urllib2 import urllib import json url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&" query = raw_input("What do you want to search for ? >> ") query = urllib.urlencode( {'q' : query } ) response = urllib2.urlopen (url + query ).read() data = json.loads ( response ) results = data [ 'responseData' ] [ 'results' ] for result in results: title = result['title'] url = result['url'] print ( title + '; ' + url ) |
438 |
4,545 |
0.978 |
115.32 — (sidd_) |
89.90 |
44.87 |
October 3, 2018 |
18. |
#10024 |
template<typename ...Args> bool all(Args ...args) { return (... && args); } bool b = all(true, true, true, false); // Within the instantiation of all, the returned expression expands to ((true && true) && true) && false, which evaluates to false. |
246 |
19 |
0.949 |
87.93 — washed (zak389) |
53.28 |
53.28 |
December 4, 2023 |
19. |
#10007 |
(publish :path "/hello-count" :content-type "text/html" :function (let ((count 0)) #'(lambda (req ent) (with-http-response (req ent) (with-http-body (req ent) (html (:html (:head (:title "Hello Counter")) (:body ((:font :color (nth (random 5) '("red" "blue" "green" "purple" "black"))) "Hello World had been called " (:princ (incf count)) " times"))))))))) |
356 |
5,396 |
0.949 |
282.71 — 666 (dapoerlink321) |
88.31 |
44.74 |
November 19, 2009 |
20. |
#10004 |
this = (fsm_instance *)kmalloc(sizeof(fsm_instance), order); if (this == NULL) { printk(KERN_WARNING "fsm(%s): init_fsm: Couldn't alloc instance\n", name); return NULL; } memset(this, 0, sizeof(fsm_instance)); strlcpy(this->name, name, sizeof(this->name)); |
256 |
6,765 |
0.939 |
132.63 — Sean Wrona (arenasnow) |
90.31 |
43.55 |
December 5, 2009 |
21. |
#10008 |
(defop hello2 req (w/link (pr "there") (pr "here"))) (defop hello3 req (w/link (w/link (pr "end") (pr "middle")) (pr "start"))) (defop hello4 req (aform [w/link (pr "you said: " (arg _ "foo")) (pr "click here")] (input "foo") (submit))) |
236 |
6,779 |
0.923 |
187.09 — josugamer (ttmm22) |
90.86 |
42.48 |
December 6, 2009 |
22. |
#10011 |
print("2 + 2 is {}, minus 1 that's {}. quick maths.".format(2 + 2, 2 + 2 - 1)) |
78 |
5,435 |
0.922 |
245.99 — Drago (ldragol) |
92.30 |
40.02 |
December 29, 2017 |
23. |
#10003 |
int res; unsigned long flags; u32 data = 0; if (PCI_##size##_BAD) return PCIBIOS_BAD_REGISTER_NUMBER; spin_lock_irqsave(&pci_lock, flags); res = bus->ops->read(bus, devfn, pos, len, &data); *value = (type)data; spin_unlock_irqrestore(&pci_lock, flags); return res; |
264 |
6,437 |
0.918 |
128.30 — chillin (slekap) |
91.12 |
42.54 |
December 5, 2009 |
24. |
#10013 |
if (response) { try { var dealData = JSON.parse(response); // Try to parse JSON showContent(dealData); // Show JSON data } catch(e) { var errorMessage = e.name + ' ' + e.message; // Create error msg console.log(errorMessage); // Show devs msg feed.innerHTML = '<em>Sorry, could not load deals</em>';// Show users msg } finally { var link = document.createElement('a'); // Add refresh link link.innerHTML = ' <a href="try-catch-finally.html">reload</a>'; feed.appendChild(link); } } |
501 |
52 |
0.866 |
112.00 — (sidd_) |
64.12 |
64.12 |
October 3, 2018 |
25. |
#10023 |
auto monad = [](auto v) { return [=] { return v; }; }; auto bind = [](auto m) { return [=](auto fvm) { return fvm(m()); }; }; static_assert(bind(monad(2))(monad)() == monad(2)()); |
179 |
2,283 |
0.851 |
178.39 — https://www.mosessolari.com... |
71.40 |
37.05 |
December 6, 2023 |
26. |
#10012 |
var $form, width, height, area; $form = $('#calculator'); $('#calculator').on('submit', function(e) { e.preventDefault(); console.log('Clicked submit...'); width = $('#width').val(); height = $('#height').val(); area = (width * height); if (area < 100) { debugger; // A breakpoint is set if the developer tools are open } $form.append('<p>' + area + '</p>'); }); |
372 |
62 |
0.825 |
107.41 — (sidd_) |
62.33 |
62.33 |
October 2, 2018 |
27. |
#10026 |
NamedDecl *Sema::getCurFunctionOrMethodDecl() const { DeclContext *DC = getFunctionLevelDeclContext(); if (isa<ObjCMethodDecl>(DC) || isa<FunctionDecl>(DC)) return cast<NamedDecl>(DC); return nullptr; } |
202 |
56 |
0.788 |
109.68 — (poke1) |
44.12 |
44.12 |
December 4, 2023 |
28. |
#10014 |
function showContent(dealData) { var newContent = ''; for (var i in dealData.deals) { newContent += '<div class="deal">'; newContent += '<h2>' + dealData.deals[i].title + '</h2>'; newContent += '<p>' + dealData.deals[i].description + '</p>'; newContent += '<a href="' + dealData.deals[i].link + '">'; newContent += ' ' + dealData.deals[i].link; newContent +='</a>'; newContent += '</div>'; } feed.innerHTML = newContent; } |
440 |
42 |
0.713 |
90.78 — (sidd_) |
56.47 |
56.47 |
October 3, 2018 |