corrected syntax formatting of all files
This commit is contained in:
parent
1094bfdeae
commit
f23ee96cac
@ -5,8 +5,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func Battle(hero, enemy Character) {
|
func Battle(hero, enemy Character) {
|
||||||
speed := time.Second * 1
|
speed := time.Second * 1
|
||||||
|
|
||||||
@ -16,7 +14,6 @@ func Battle(hero, enemy Character) {
|
|||||||
heroInitiative := rand.Intn(7) + hero.Initiative
|
heroInitiative := rand.Intn(7) + hero.Initiative
|
||||||
enemyInitiative := rand.Intn(7) + enemy.Initiative
|
enemyInitiative := rand.Intn(7) + enemy.Initiative
|
||||||
|
|
||||||
|
|
||||||
if heroInitiative == enemyInitiative {
|
if heroInitiative == enemyInitiative {
|
||||||
if flipCoin() == "heads" {
|
if flipCoin() == "heads" {
|
||||||
heroInitiative -= 1
|
heroInitiative -= 1
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
type Character struct {
|
type Character struct {
|
||||||
Name string
|
Name string
|
||||||
Health int
|
Health int
|
||||||
@ -12,7 +10,6 @@ type Character struct {
|
|||||||
Gear PaperDoll
|
Gear PaperDoll
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
player = Character{
|
player = Character{
|
||||||
|
|
||||||
|
@ -8,10 +8,8 @@ type Weapon struct {
|
|||||||
|
|
||||||
type PaperDoll struct {
|
type PaperDoll struct {
|
||||||
Weapon Weapon
|
Weapon Weapon
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
Broadsword = Weapon{
|
Broadsword = Weapon{
|
||||||
Name: "Broadsword",
|
Name: "Broadsword",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user