Update
This commit is contained in:
parent
95e6641b63
commit
6babe76b2a
24 changed files with 1893 additions and 1873 deletions
|
@ -219,7 +219,8 @@ Bear in mind the main purpose of this quiz is for you to test your understanding
|
|||
112. What's the difference between [lazy](lazy.md) and strict evaluation? Show simple example.
|
||||
113. Write code in [Brainfuck](brainfuck.md) that copies the value in current cell to the cell on to the right, while KEEPING the value in current cell. Of course you may use another temporary cell to do this.
|
||||
114. What's the first sentence of the lyrics of the [Free Software](free_software.md) Song by [Richard Stallman](rms.md)?
|
||||
115. Did you enjoy this quiz?
|
||||
115. Consider we record moves in [chess](chess.md) with a simple notation as *<SQUARE_FROM><SQUARE_TO>*, for example *e3e5* or *g1f3* (i.e. we don't care about which chessman moves, if check or promotion happens etc., only start and end square are recorded). How many such moves exist if we only consider those that can ever legally happen (i.e. don't count moves such as *a2g1*, *b3b3* and so on)? Castling just means moving the king to his castled position.
|
||||
116. Did you enjoy this quiz?
|
||||
|
||||
### Answers
|
||||
|
||||
|
@ -338,7 +339,8 @@ sin(x) / cos(x) - log2(2) = tg(x) - 1*, so we get *tg(x) >= 1*. So that will hol
|
|||
112. They're both strategies for evaluating [expressions](expression.md): lazy (also *by need*) evaluates an argument ONLY once it's actually needed, while strict evaluation evaluates all arguments, even if some might not be needed. Example: let's have a function `or3(a,b,c)` which performs logical OR of three values; under strict evaluation all *a*, *b* and *c* will be evaluated and then logical OR will be performed; under lazy evaluation the function may first evaluate one argument, let's say *a*, and if it ends up being TRUE, there is no need to further evaluate *b* and *c* (the result is already known to be TRUE), so they won't be evaluated.
|
||||
113. For example `[->+>+<<]>>[-<<+>>]<<`: first we copy the current cell into TWO cells to the right -- one of them is used as a temporary cell; after this we use another loop to copy the value from the temporary cell back to the original location that we zeroes during the first copying.
|
||||
114. "Join us now and share the software."
|
||||
115. yes
|
||||
115. Should be 1792 { Unless I counted it wrong lol. ~drummyfish }. We can count this by just considering each square on the board and summing all possible queen and knight moves from that square (queen and knight together cover all possible moves). Queen can obviously end up on any square and from knight's walk we know we can place a knight anywhere as well. This can probably be computed even manually but writing a quick program does the job quicker.
|
||||
116. yes
|
||||
|
||||
## Other
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue