exercism / exercism/javascript-analyzer

Improve resistor-color-duo: map to math

オープン
#51 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
16
フォーク
21
平均マージ
6時間 53分
マージ済み PR(30日)
2

説明

**Describe the improvement**:

When an _optimal `map`_ solution is provided, the analyzer should `approve` but provide a comment that allows them to _continue_ the path.

```
Perhaps there is a solution that does not involve type-juggling: the act of creating a
_string_ of numbers (the digits) and then parsing it back into a number. For example:
what _value_ does the `4` in the number `42` hold.

You may continue with the next exercise, or try out submitting a more math-y solution
and continue here.
```

**Which exercise**

`resistor-color-duo`

**Additional context**

The `ResistorColorDuoAnalyzer` has a method that checks if an exercise _is optimal_. There are various ways to branch based on that optimality. As per the commentary above, using a `map` is _approvable_ but not _optimal_.

- [`ResistorColorDuoSolution::Entry#isOptimal`](https://github.com/exercism/javascript-analyzer/blob/master/src/analyzers/resistor-color-duo/ResistorColorDuoSolution.ts#L278-L312)
- [`ResistorColorDuoAnalyzer#checkForTips`](https://github.com/exercism/javascript-analyzer/blob/master/src/analyzers/resistor-color-duo/index.ts#L268)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。