Skip to content

Fibonacci Exercise: Solution does not use readme sequence #658

Description

@beryllus

Prerequisites

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • I have searched the existing issues to ensure this improvement hasn't been suggested before (please have a look through our open issues list to make sure)
  • The title of this issue follows the <Location of the improvement>: <Brief description of the improvement> format, e.g. Exercises: Add exercise on XYZ
  • (Optional) I am interested in working on this issue and would like to be assigned to it

Improvement Description

The readme for this exercise explicitly says that

In this exercise, the Fibonacci sequence used is 1, 1, 2, 3, 5, 8, etc.

But the solution included in this exercise starts the count from 0, the first number (secondPrev) being 0 and the current number (firstPrev) being 1.

    let firstPrev = 1;
    let secondPrev = 0;

    for (let i = 2; i <= count; i++) {
        let current = firstPrev + secondPrev;
        secondPrev = firstPrev;
        firstPrev = current;
    }

Unless I am just not understanding the solution well, I think this could confuse learners that might have expected to see the solution use the same sequence as instructed in the readme.

Acceptance Criteria

  • The solution for this exercise is adjusted to match the sequence said to be used in the readme (1, 1, 2, 3, 5, 8, etc.)

(Optional) Additional Comments

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs ReviewThis issue/PR needs an initial or additional review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions