Skip to content

Commit

Permalink
Merge branch 'YutaOkoshi-feat/add_sesame'
Browse files Browse the repository at this point in the history
  • Loading branch information
Doarakko committed Apr 2, 2022
2 parents f582c2a + 512efe4 commit e63a9f1
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# http://editorconfig.org

# this file is the top-most editorconfig file
root = true

# all files
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[*.go]
indent_size = 4
indent_style = tab
12 changes: 12 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func saveImage(filename string, img image.Image) error {

var toppings [6]Topping
var top Topping
var topWithSesame Topping
var bottom Topping

func init() {
Expand All @@ -67,6 +68,11 @@ func init() {
log.Fatal(err)
}

topWithSesame.Img, err = loadImage(fs, "/top-sesame.png")
if err != nil {
log.Fatal(err)
}

bottom.Img, err = loadImage(fs, "/bottom.png")
if err != nil {
log.Fatal(err)
Expand Down Expand Up @@ -108,16 +114,22 @@ func main() {
var nBurger int
var rInterval float64
var fileName string
var sesame bool

flag.IntVar(&nBurger, "n", 1, "number of big burger")
flag.Float64Var(&rInterval, "i", 1.0, "rate of intervals")
flag.StringVar(&fileName, "o", "", "output image file")
flag.BoolVar(&sesame, "s", false,"buns with sesame")

for i := 0; i < len(toppings); i++ {
flag.IntVar(&toppings[i].Count, toppings[i].Option, toppings[i].Count, fmt.Sprintf("how many %s", toppings[i].Name))
}
flag.Parse()

if sesame{
top = topWithSesame
}

// Count number of unique toppings
uniqueToppingCount := 0
for i := 0; i < len(toppings); i++ {
Expand Down
Binary file added public/top-sesame.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions statik/statik.go

Large diffs are not rendered by default.

0 comments on commit e63a9f1

Please sign in to comment.