Skip to content

Commit

Permalink
iphone only allows numbers and 18 or less
Browse files Browse the repository at this point in the history
  • Loading branch information
manucamejo committed Sep 13, 2024
1 parent 8cc09ad commit 651b5e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/game_backend/lib/game_backend/configuration.ex
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,10 @@ defmodule GameBackend.Configuration do
|> List.flatten()
|> Enum.map(fn config -> sum_shape_coordinates(config) end)
|> Enum.reduce(fn coordinates_last, coordinates_current -> Decimal.add(coordinates_last, coordinates_current) end)
|> Decimal.to_string()
|> (fn coordinates -> :crypto.hash(:sha, coordinates) |> Base.encode16() end).()
|> Decimal.to_float()
|> :math.pow(2)
|> round()
|> Integer.to_string()
end

# The following function retrieves a number representing a shape's figure.
Expand Down

0 comments on commit 651b5e8

Please sign in to comment.