Skip to content

Commit

Permalink
Merge pull request #42 from valeriyvan/main-formatting
Browse files Browse the repository at this point in the history
Code formatting in main function
  • Loading branch information
valeriyvan authored Aug 19, 2023
2 parents b2d810b + 66d3f1b commit c8d85b8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Sources/geometrize-cli/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,18 @@ let rect = Rectangle(
shapeData.append(ShapeResult(score: 0, color: targetBitmap.averageColor(), shape: rect))

var counter = 0
while shapeData.count <= shapeCount /* Here set count of shapes final image should have. Remember background is the first shape. */ {
// Here in shapeCount set count of shapes final image should have.
// Remember background is the first shape.
while shapeData.count <= shapeCount {
if options.verbose {
print("Step \(counter)", terminator: "")
}
let shapes = runner.step(options: runnerOptions, shapeCreator: nil, energyFunction: defaultEnergyFunction, addShapePrecondition: defaultAddShapePrecondition)
let shapes = runner.step(
options: runnerOptions,
shapeCreator: nil,
energyFunction: defaultEnergyFunction,
addShapePrecondition: defaultAddShapePrecondition
)
if shapes.isEmpty {
if options.verbose {
print(", no shapes added.", terminator: "")
Expand Down

0 comments on commit c8d85b8

Please sign in to comment.