exercism / exercism/javascript-analyzer

Improve resistor-color-duo: map to math

未关闭
#51 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
16
派生
21
平均合并
6 小时 53 分钟
30 天内合并 PR
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 摘要。