This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These are some features. They can be implemented in any order you prefer. | |
* an elevator responds to calls containing a source floor and direction | |
* an elevator delivers passengers to requested floors | |
* an elevator doesn't respond immediately. consider options to simulate time | |
* elevator calls are queued not necessarily FIFO | |
* you may test a sequence of events happening when passengers use the elevator | |
* you may implement current floor monitor | |
* you may implement direction arrows | |
* you may implement doors (opening and closing) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Запрограмируйте подсчет очков партии игры в боулинг. | |
Одна партия состоит из 10 фреймов. | |
В каждом фрейме у игрока есть два броска. | |
Если игрок сбивает все 10 кеглей первым броском, | |
такой бросок называется страйк (англ. strike — удар) и обозначается «Х». | |
Если игрок сбивает все 10 кеглей за два броска, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Напишите программу, печатающую числа от 1 до 100. | |
При этом, для чисел делящихся на три, печатайте вместо них "Fizz", | |
для чисел делящихся на пять, печатайте "Buzz", | |
a для чисел делящихся и на три, и на пять, печатайте "FizzBuzz" | |
Пример: | |
1 | |
2 | |
Fizz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Марс представлен сеткой 5 x 5. | |
Вам дается начальная точка старта (x, y) марсохода и направление север/юг/восток/запад(N, S, E, W), в котором он смотрит. | |
Марсоход получает символьный массив команд. | |
- Реализуйте команды, которые перемещают ровер вперед / назад (f, b ). | |
- Выполните команды, которые поворачивают ровер влево / вправо (l, r). | |
- Осуществить перенос от одного края сетки к другому. | |
- Реализуйте обнаружение препятствий перед каждым переходом на новый квадрат: | |
Если данная последовательность команд встречает препятствие, | |
марсоход движется до последней возможной точки, | |
прерывает последовательность и сообщает о препятствии. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mars is represented by a 5 x 5 grid. | |
You are given the initial starting point (x,y) of a rover and the direction (N,S,E,W) it is facing. | |
The rover receives a character array of commands. | |
- Implement commands that move the rover forward/backward (f,b). | |
- Implement commands that turn the rover left/right (l,r). | |
- Implement wrapping from one edge of the grid to another. | |
- Implement obstacle detection before each move to a new square: | |
If a given sequence of commands encounters an obstacle, | |
the rover moves up to the last possible point, | |
aborts the sequence and reports the obstacle. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.junit.Assert.fail; | |
import java.util.HashSet; | |
import java.util.Set; | |
import java.util.stream.Collectors; | |
import javax.persistence.EmbeddedId; | |
import javax.persistence.IdClass; | |
import org.reflections.Reflections; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressWarnings({"null", "unchecked"}) | |
public static <V, R> Collector<V, ?, List<R>> combine(List<Collector<V, ?, R>> collectors) { | |
final Supplier<List<Object>> supplier = () -> collectors.stream().map(Collector::supplier) | |
.map(Supplier::get).collect(Collectors.toList()); | |
final BiConsumer<List<Object>, V> biConsumer = (List<Object> list, V e) -> IntStream.range(0, collectors.size())// | |
.forEach(i -> ((BiConsumer<Object, V>) collectors.get(i).accumulator()).accept(list.get(i), e)); | |
final BinaryOperator<List<Object>> binaryOperator = (List<Object> l1, List<Object> l2) -> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o errexit | |
solutionDir="$(exercism download --uuid $@)" | |
echo "$solutionDir" | |
cd "$solutionDir" | |
find src/test -type f -print -exec sed -i "s%@Ignore%// @Ignore%g" '{}' \; | |
gradle clean test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
81 cards all unique | |
shuffle deck | |
draw 12 cards | |
maybe<set> findsSET(cqrds) | |
1 card : 4 features | |
feature : values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.scalatest.Matchers | |
case class Point(x: Int, y: Int) | |
sealed trait Direction | |
case object N extends Direction | |
case object S extends Direction |
NewerOlder