Skip to content

olegchobotar/ideas-island

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published