Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

A simple contest, inspired by this stackoverflow questionthis stackoverflow question:

You are given an image of a surface photographed by a satellite.The image is a bitmap where water is marked by '.' and land is marked by '*'. Groups of adjacent '*'s form an island. (Two '*' are adjacent if they are horizontal, vertical or diagonal neighbours). Your task is to print the number of islands in the bitmap.

A single * also counts as an island.

Sample Input:

.........**
**......***
...........
...*.......
*........*.
*.........*

Sample Output:

5

Winner is entry with smallest number of bytes in the code.

A simple contest, inspired by this stackoverflow question:

You are given an image of a surface photographed by a satellite.The image is a bitmap where water is marked by '.' and land is marked by '*'. Groups of adjacent '*'s form an island. (Two '*' are adjacent if they are horizontal, vertical or diagonal neighbours). Your task is to print the number of islands in the bitmap.

A single * also counts as an island.

Sample Input:

.........**
**......***
...........
...*.......
*........*.
*.........*

Sample Output:

5

Winner is entry with smallest number of bytes in the code.

A simple contest, inspired by this stackoverflow question:

You are given an image of a surface photographed by a satellite.The image is a bitmap where water is marked by '.' and land is marked by '*'. Groups of adjacent '*'s form an island. (Two '*' are adjacent if they are horizontal, vertical or diagonal neighbours). Your task is to print the number of islands in the bitmap.

A single * also counts as an island.

Sample Input:

.........**
**......***
...........
...*.......
*........*.
*.........*

Sample Output:

5

Winner is entry with smallest number of bytes in the code.

Clarified rules
Source Link
user42649
user42649

A simple contest, inspired by this stackoverflow question:

You are given an image of a surface photographed by a satellite.The image is a bitmap where water is marked by '.' and land is marked by '*'. Adjacent groupGroups of adjacent '*'s form an island. (Two '*' are adjacent if they are horizontal, vertical or diagonal neighbours). Your task is to print the number of islands in the bitmap.

A single * also counts as an island.

Sample Input:

.........**
**......***
...........
...*.......
*........*.
*.........*

Sample Output:

5

Winner is entry with smallest number of bytes in the code.

A simple contest, inspired by this stackoverflow question:

You are given an image of a surface photographed by a satellite.The image is a bitmap where water is marked by '.' and land is marked by '*'. Adjacent group of '*'s form an island. (Two '*' are adjacent if they are horizontal, vertical or diagonal neighbours). Your task is to print the number of islands in the bitmap.

Sample Input:

.........**
**......***
...........
...*.......
*........*.
*.........*

Sample Output:

5

Winner is entry with smallest number of bytes in the code.

A simple contest, inspired by this stackoverflow question:

You are given an image of a surface photographed by a satellite.The image is a bitmap where water is marked by '.' and land is marked by '*'. Groups of adjacent '*'s form an island. (Two '*' are adjacent if they are horizontal, vertical or diagonal neighbours). Your task is to print the number of islands in the bitmap.

A single * also counts as an island.

Sample Input:

.........**
**......***
...........
...*.......
*........*.
*.........*

Sample Output:

5

Winner is entry with smallest number of bytes in the code.

Tweeted twitter.com/#!/StackCodeGolf/status/236204590108905472
Source Link
Claudiu
  • 4.1k
  • 1
  • 22
  • 26

Code-Golf: Count Islands

A simple contest, inspired by this stackoverflow question:

You are given an image of a surface photographed by a satellite.The image is a bitmap where water is marked by '.' and land is marked by '*'. Adjacent group of '*'s form an island. (Two '*' are adjacent if they are horizontal, vertical or diagonal neighbours). Your task is to print the number of islands in the bitmap.

Sample Input:

.........**
**......***
...........
...*.......
*........*.
*.........*

Sample Output:

5

Winner is entry with smallest number of bytes in the code.