summaryrefslogtreecommitdiff
path: root/prolog/problems/old_exams/pascal_3
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-01-13 13:51:15 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-01-13 13:51:15 +0100
commit388b32039898cc8f1784378689007254eb7a33b6 (patch)
treeac9e4c6145ad323dc5479179a04f44bbcea73eff /prolog/problems/old_exams/pascal_3
parente36a8a2feca7552d236c0f6e89ac73e7e690e7b1 (diff)
Remove space-padding from <pre> blocks
Diffstat (limited to 'prolog/problems/old_exams/pascal_3')
-rw-r--r--prolog/problems/old_exams/pascal_3/en.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/prolog/problems/old_exams/pascal_3/en.py b/prolog/problems/old_exams/pascal_3/en.py
index bd17577..8481bd6 100644
--- a/prolog/problems/old_exams/pascal_3/en.py
+++ b/prolog/problems/old_exams/pascal_3/en.py
@@ -1,27 +1,27 @@
# coding=utf-8
name = 'pascal/3'
-slug = 'pascal's triangle'
+slug = 'pascal’s triangle'
description = '''\
<p>The first five rows of the Pascal's triangle look like this:</p>
<pre>
- 1
- 1 1
- 1 2 1
- 1 3 3 1
- 1 4 6 4 1
+ 1
+ 1 1
+ 1 2 1
+ 1 3 3 1
+1 4 6 4 1
</pre>
<p>
Each row begins and ends with 1. Every other element can be obtained as a sum of the two values above it. Write the predicate <code>pascal(I,J,N)</code> that returns the <code>J</code>-th value in the <code>I</code>-th column of the Pascal's triangle. Your solution should return exactly one answer for any input (the <code>I</code> and <code>J</code> arguments start counting with 0; you can assume that 0 ≤ <code>J</code> ≤ <code>I</code>).
<pre>
- ?- pascal(0, 0, N).
- N = 1.
- ?- pascal(2, 1, N).
- N = 2.
- ?- pascal(4, 3, N).
- N = 4.
+?- pascal(0, 0, N).
+ N = 1.
+?- pascal(2, 1, N).
+ N = 2.
+?- pascal(4, 3, N).
+ N = 4.
</pre>'''
hint = {}