Skip to content

Commit

Permalink
more cute name combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Mar 22, 2021
1 parent bd3e53f commit bce4214
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions modules/common/src/main/CuteNameGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ object CuteNameGenerator {

type CuteName = String

def make(maxSize: Int = 17, triesLeft: Int = 100): Option[CuteName] = {
def make(maxSize: Int = 20, triesLeft: Int = 100): Option[CuteName] = {
val name = makeForSure
if (name.sizeIs <= maxSize) name.some
else if (triesLeft <= 0) none
Expand All @@ -24,12 +24,12 @@ object CuteNameGenerator {
vec(Math.abs(seed) % vec.size)

lazy val combinations: Vector[List[Vector[String]]] = Vector(
List(adjectives, nouns)
List(colors ++ adjectives, animals ++ pieces ++ jobs),
List(colors, adjectives, animals ++ pieces ++ jobs),
List(colors ++ adjectives, adjectives, animals ++ pieces ++ jobs),
List(colors ++ adjectives, jobs, animals ++ pieces)
)

val adjectives = colors ++ positiveAdjectives
val nouns = animals ++ pieces ++ jobs

def colors =
Vector(
"Amber",
Expand Down Expand Up @@ -258,7 +258,7 @@ object CuteNameGenerator {
"Zebra"
)

def positiveAdjectives =
def adjectives =
Vector(
"Abiding",
"Able",
Expand Down Expand Up @@ -1237,12 +1237,14 @@ object CuteNameGenerator {
"Chef",
"Chemist",
"Choreographer",
"Coder",
"Dancer",
"Dentist",
"Diver",
"Doctor",
"Drummer",
"Duelist",
"Fan",
"Farmer",
"Florist",
"Flutist",
Expand All @@ -1253,12 +1255,14 @@ object CuteNameGenerator {
"Harpist",
"Journalist",
"Judge",
"Lawyer",
"Musician",
"Ninja",
"Nurse",
"Officer",
"Optician",
"Pianist",
"Player",
"Runner",
"Singer",
"Trumpeter",
Expand Down

0 comments on commit bce4214

Please sign in to comment.