Skip to content

ccfontes/the-flood

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

the-flood

A Clojure Library for the Flood Fill algorithm.

The code was copied from a reddit challenge and only minor changes were made.

Installing the Arkifact


Add the following entry to the :dependencies vector of your project.clj file: [clojars version] (https://clojars.org/the-flood)

Flooding the Earth


user=> (require '[the-flood.core :refer [flood-fill]])
nil
user=> (flood-fill [["O" "O" "O" "O" "O"]
                    ["O" "O" "O" "O" "O"]
                    ["O" "A" "O" "O" "O"]
                    ["O" "O" "O" "O" "O"]
                    ["O" "O" "O" "O" "O"]
                    ["O" "O" "O" "O" "O"]]
          [1 1] "R" nil)
;=>          
[["R" "R" "R" "R" "R"]
 ["R" "R" "R" "R" "R"]
 ["R" "A" "R" "R" "R"]
 ["R" "R" "R" "R" "R"]
 ["R" "R" "R" "R" "R"]
 ["R" "R" "R" "R" "R"]]

About

A Clojure Library for the Flood Fill Algorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published