1.1.0 • Published 2 months ago

ideas-island v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

Island Area Calculator

This JavaScript script calculates the area of an island represented by a matrix of 1s and 0s, where 1 represents land and 0 represents water.

Usage

  1. Clone the repository:

    git clone [https://github.com/your-username/island-area-calculator.git](https://github.com/olegchobotar/ideas-island.git)
  2. Navigate to the project directory:

    cd ideas-island
  3. Install dependencies (not required for this example, but your project may have dependencies in the future):

    # This example doesn't have dependencies, but you may have them in your project
  4. Run the script:

    node island-calculator.js
  5. Modify the islandMatrix variable in island-calculator.js to represent your own islands and run the script again.

Example

const islandMatrix = [
    [1, 1, 0, 0, 1],
    [1, 0, 0, 1, 0],
    [0, 1, 1, 1, 0],
    [0, 0, 0, 0, 0],
    [1, 1, 1, 0, 1]
];

const area = calculateIslandArea(islandMatrix);
console.log('Island Area:', area);
1.1.0

2 months ago

1.0.2

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago