Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ArhanChaudhary committed Aug 25, 2024
1 parent d4ae5e4 commit 64e71ac
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 82 deletions.
20 changes: 10 additions & 10 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,8 @@
(e.target as HTMLInputElement).value = '';
if (
data.numbers.some(({ value, guessed }) => value.toString() === guess && guessed) ||
data.technicallyIncorrectNumbers.some(
({ value, guessed }) => value.toString() === guess && guessed
)
data.numbers.some(({ value, guessed }) => value === guess && guessed) ||
data.technicallyIncorrectNumbers.some(({ value, guessed }) => value === guess && guessed)
) {
modals = [
...modals,
Expand All @@ -87,21 +85,21 @@
}
let technicallyIncorrectNumber = data.technicallyIncorrectNumbers.find(
({ value }) => value.toString() === guess
({ value }) => value === guess
);
if (technicallyIncorrectNumber) {
modals = [
...modals,
{
value: guess,
message: technicallyIncorrectNumber.message,
message: `${technicallyIncorrectNumber.message} is not an intended number. Your guess won't count.`,
guessType: GuessType.technicallyIncorrect
}
];
return;
}
let number = data.numbers.find(({ value }) => value.toString() === guess);
let number = data.numbers.find(({ value }) => value === guess);
if (number) {
modals = [
...modals,
Expand Down Expand Up @@ -166,11 +164,13 @@
<br />
<ol class="list-decimal pl-[2ch]">
<li>
You are being timed. Despite that, <b>prioritize minimizing guesses (&lt;30 guesses) and avoid brute force</b>.
You are being timed. Despite that, <b
>prioritize minimizing guesses (&lt;30 guesses) and avoid brute force</b
>.
</li>
<li>
There are {numbersCount} distinct iconic computing numbers hidden within this string without overlap, ignore the
line wrapping.
There are {numbersCount} distinct iconic computing numbers hidden within this string without overlap,
ignore the line wrapping.
</li>
<li>
This is not a memory test; you should be able to identify each number with little ambiguity
Expand Down
109 changes: 37 additions & 72 deletions src/routes/+page.ts
Original file line number Diff line number Diff line change
@@ -1,194 +1,159 @@
const numbers = [
{
value: 1970,
value: '1970',
message:
'The UNIX epoch year for universal computer time representation. One of the first magic numbers you learn in computer science.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/Unix_time'
},
{
value: 192168,
value: '192168',
message: 'The most commonly used private IPv4 address range, formally 192.168.0.0/16.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/Private_network#Private_IPv4_addresses'
},
{
value: 1337,
value: '1337',
message: '"Leet", in hacker speech.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/Leet'
},
{
value: 754,
value: '754',
message: 'The IEEE standard for floating-point arithmetic used by every modern computer.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/IEEE_754'
},
{
value: 8086,
value: '8086',
message: 'The Intel 8086, the first microprocessor with the now-widespread x86 architecture.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/Intel_8086'
},
{
value: 214748,
value: '214748',
message:
'2^31 - 1 truncated, or the maximum value for a 32-bit signed binary integer. Also a common hard limit in video games.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/2147483647'
},
{
value: 418,
value: '418',
message: 'The HTTP status code for "I\'m a teapot", an April Fools\' joke by the IETF.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol'
},
{
value: 443,
value: '443',
message: 'The default port for HTTPS.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/HTTPS#Difference_from_HTTP'
},
{
value: 414141,
value: '414141',
message:
'"AAA ..." in hexadecimal, a string often used in buffer overflow attacks and other security exploits.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/Buffer_overflow'
},
{
value: 44100,
value: '44100',
message: 'The standard sampling rate for digital and analog audio.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/44,100_Hz'
},
{
value: 3301,
value: '3301',
message: 'The Cicada 3301 internet mystery, popularized by LEMMiNO.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/Cicada_3301'
},
{
value: 9600,
value: '9600',
message: 'A common baud rate for serial communication.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/Baud'
},
{
value: 80211,
value: '80211',
message: 'The IEEE standard for wireless networking, or Wi-Fi.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/IEEE_802.11'
},
{
value: 400000,
value: '400000',
message: 'The base virtual memory address for Linux executables in hexadecimal.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/Virtual_memory'
},
{
value: 25519,
value: '25519',
message: 'Curve25519, a widely used elliptic curve in cryptography and key exchange.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/Curve25519'
},
{
value: 264,
value: '264',
message: 'H.264 or Advanced Video Coding, a common video compression standard.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/Advanced_Video_Coding'
},
{
value: 509,
value: '509',
message: 'The X.509 ITU certificate standard, used in TLS and SSL.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/X.509'
},
{
value: 65537,
value: '65537',
message: 'The most commonly chosen exponent in the RSA cryptosystem.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/65537#Applications'
},
{
value: 777,
value: '777',
message: 'The chmod octal permission mode for full access.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/Chmod'
},
{
value: 7400,
value: '7400',
message:
'A popular series of digital logic integrated circuits, once the most popular for TTL.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/7400-series_integrated_circuits'
},
{
value: 8601,
value: '8601',
message: 'The ISO standard for human-readable universal date and time representation.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/ISO_8601'
},
{
value: 2600,
value: '2600',
message:
'2600: The Hacker Quarterly, a popular technical magazine, referencing the 2600Hz phreaking tone.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/2600:_The_Hacker_Quarterly'
},
{
value: 5994,
value: '5994',
message: 'The field refresh frequency for NTSC color.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/NTSC#Resolution_and_refresh_rate'
},
{
value: 437,
value: '437',
message: 'The original IBM PC code page.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/Code_page_437'
},
{
value: 471768,
value: '471768',
message:
'The truncated solution to the 25-year-long Busy Beaver Challenge for 5-state 2-symbol Turing machines.',
guessed: false,
link: 'https://en.wikipedia.org/wiki/Busy_Beaver'
}
];
].map((number) => ({ ...number, guessed: false }));

const technicallyIncorrectNumbers = [
{
value: 775,
message:
"The chmod octal permission mode for full access is not an intended number. Your guess won't count.",
guessed: false
value: '775',
message: 'The chmod octal permission mode for full access'
},
{
value: 255,
message:
"The maximum value for an 8-bit unsigned integer is not an intended number. Your guess won't count.",
guessed: false
value: '255',
message: 'The maximum value for an 8-bit unsigned integer'
},
{
value: 301,
message:
'The HTTP status code for "Moved Permanently" is not an intended number. Your guess won\'t count.',
guessed: false
value: '301',
message: 'The HTTP status code for "Moved Permanently"'
},
{
value: 400,
message:
'The HTTP status code for "Bad Request" is not an intended number. Your guess won\'t count.',
guessed: false
value: '400',
message: 'The HTTP status code for "Bad Request"'
},
{
value: 860,
message:
'The Intel i860 microprocessor is not an intended number. Your guess won\'t count.',
guessed: false
value: '860',
message: 'The Intel i860 microprocessor'
}
];
].map((number) => ({ ...number, guessed: false }));

export function load() {
return { numbers, technicallyIncorrectNumbers };
Expand Down

0 comments on commit 64e71ac

Please sign in to comment.