Fix curly quotes
This commit is contained in:
@ -8,13 +8,13 @@ challengeType: 5
|
|||||||
<section id='description'>
|
<section id='description'>
|
||||||
This task is a variation of the <a href='https://en.wikipedia.org/wiki/The Nine Billion Names of God#Plot_summary' title='wp: The Nine Billion Names of God#Plot_summary' target='_blank'>short story by Arthur C. Clarke</a>.
|
This task is a variation of the <a href='https://en.wikipedia.org/wiki/The Nine Billion Names of God#Plot_summary' title='wp: The Nine Billion Names of God#Plot_summary' target='_blank'>short story by Arthur C. Clarke</a>.
|
||||||
(Solvers should be aware of the consequences of completing this task.)
|
(Solvers should be aware of the consequences of completing this task.)
|
||||||
In detail, to specify what is meant by a “name”:
|
In detail, to specify what is meant by a "name":
|
||||||
<ul>
|
<ul>
|
||||||
<li>The integer 1 has 1 name “1”.</li>
|
<li>The integer 1 has 1 name "1".</li>
|
||||||
<li>The integer 2 has 2 names “1+1” and “2”.</li>
|
<li>The integer 2 has 2 names "1+1" and "2".</li>
|
||||||
<li>The integer 3 has 3 names “1+1+1”, “2+1”, and “3”.</li>
|
<li>The integer 3 has 3 names "1+1+1", "2+1", and "3".</li>
|
||||||
<li>The integer 4 has 5 names “1+1+1+1”, “2+1+1”, “2+2”, “3+1”, “4”.</li>
|
<li>The integer 4 has 5 names "1+1+1+1", "2+1+1", "2+2", "3+1", "4".</li>
|
||||||
<li>The integer 5 has 7 names “1+1+1+1+1”, “2+1+1+1”, “2+2+1”, “3+1+1”, “3+2”, “4+1”, “5”.</li>
|
<li>The integer 5 has 7 names "1+1+1+1+1", "2+1+1+1", "2+2+1", "3+1+1", "3+2", "4+1", "5".</li>
|
||||||
</ul>
|
</ul>
|
||||||
This can be visualized in the following form:
|
This can be visualized in the following form:
|
||||||
<pre>
|
<pre>
|
||||||
|
@ -7,7 +7,7 @@ challengeType: 5
|
|||||||
## Description
|
## Description
|
||||||
<section id='description'>
|
<section id='description'>
|
||||||
A generator is an executable entity (like a function or procedure) that contains code that yields a sequence of values, one at a time, so that each time you call the generator, the next value in the sequence is provided.
|
A generator is an executable entity (like a function or procedure) that contains code that yields a sequence of values, one at a time, so that each time you call the generator, the next value in the sequence is provided.
|
||||||
Generators are often built on top of coroutines or objects so that the internal state of the object is handled “naturally”.
|
Generators are often built on top of coroutines or objects so that the internal state of the object is handled "naturally".
|
||||||
Generators are often used in situations where a sequence is potentially infinite, and where it is possible to construct the next value of the sequence with only minimal state.
|
Generators are often used in situations where a sequence is potentially infinite, and where it is possible to construct the next value of the sequence with only minimal state.
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@ challengeType: 5
|
|||||||
Write a simple reader/parser for S-Expressions that handles quoted and unquoted strings, integers and floats.
|
Write a simple reader/parser for S-Expressions that handles quoted and unquoted strings, integers and floats.
|
||||||
The function should read a single but nested S-Expression from a string and return it as a (nested) array.
|
The function should read a single but nested S-Expression from a string and return it as a (nested) array.
|
||||||
Newlines and other whitespace may be ignored unless contained within a quoted string.
|
Newlines and other whitespace may be ignored unless contained within a quoted string.
|
||||||
“<tt>()</tt>” inside quoted strings are not interpreted, but treated as part of the string.
|
"<tt>()</tt>" inside quoted strings are not interpreted, but treated as part of the string.
|
||||||
Handling escaped quotes inside a string is optional; thus “<tt>(foo"bar)</tt>” maybe treated as a string “<tt>foo"bar</tt>”, or as an error.
|
Handling escaped quotes inside a string is optional; thus "<tt>(foo"bar)</tt>" maybe treated as a string "<tt>foo"bar</tt>", or as an error.
|
||||||
For this, the reader need not recognize “<tt>\</tt>” for escaping, but should, in addition, recognize numbers if the language has appropriate datatypes.
|
For this, the reader need not recognize "<tt>\</tt>" for escaping, but should, in addition, recognize numbers if the language has appropriate datatypes.
|
||||||
Note that with the exception of “<tt>()"</tt>” (“<tt>\</tt>” if escaping is supported) and whitespace there are no special characters. Anything else is allowed without quotes.
|
Note that with the exception of "<tt>()"</tt>" ("<tt>\</tt>" if escaping is supported) and whitespace there are no special characters. Anything else is allowed without quotes.
|
||||||
The reader should be able to read the following input
|
The reader should be able to read the following input
|
||||||
<pre>
|
<pre>
|
||||||
((data "quoted data" 123 4.5)
|
((data "quoted data" 123 4.5)
|
||||||
|
@ -14,7 +14,7 @@ US New York
|
|||||||
US Birmingham
|
US Birmingham
|
||||||
UK Birmingham
|
UK Birmingham
|
||||||
</pre>
|
</pre>
|
||||||
Similarly, stable sorting on just the first column would generate “UK London” as the first item and “US Birmingham” as the last item (since the order of the elements having the same first word – “UK” or “US” – would be maintained).
|
Similarly, stable sorting on just the first column would generate "UK London" as the first item and "US Birmingham" as the last item (since the order of the elements having the same first word – "UK" or "US" – would be maintained).
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
## Instructions
|
## Instructions
|
||||||
|
@ -6,7 +6,7 @@ challengeType: 5
|
|||||||
|
|
||||||
## Description
|
## Description
|
||||||
<section id='description'>
|
<section id='description'>
|
||||||
The <a href="https://en.wikipedia.org/wiki/Sutherland-Hodgman clipping algorithm" target="_blank">Sutherland-Hodgman clipping algorithm</a> finds the polygon that is the intersection between an arbitrary polygon (the “subject polygon”) and a convex polygon (the “clip polygon”).
|
The <a href="https://en.wikipedia.org/wiki/Sutherland-Hodgman clipping algorithm" target="_blank">Sutherland-Hodgman clipping algorithm</a> finds the polygon that is the intersection between an arbitrary polygon (the "subject polygon") and a convex polygon (the "clip polygon").
|
||||||
It is used in computer graphics (especially 2D graphics) to reduce the complexity of a scene being displayed by eliminating parts of a polygon that do not need to be displayed.
|
It is used in computer graphics (especially 2D graphics) to reduce the complexity of a scene being displayed by eliminating parts of a polygon that do not need to be displayed.
|
||||||
Take the closed polygon defined by the points:
|
Take the closed polygon defined by the points:
|
||||||
<pre>[(50, 150), (200, 50), (350, 150), (350, 300), (250, 300), (200, 250), (150, 350), (100, 250), (100, 200)]</pre>
|
<pre>[(50, 150), (200, 50), (350, 150), (350, 300), (250, 300), (200, 250), (150, 350), (100, 250), (100, 200)]</pre>
|
||||||
|
Reference in New Issue
Block a user