This commit is contained in:
Claudio Maggioni 2017-05-26 16:43:12 +02:00
parent fc54510ea6
commit d847623014
2 changed files with 28 additions and 36 deletions

View file

@ -14,7 +14,7 @@ type Element struct { //struttura che contiene sia cibo sia amebe
} }
func (e Element) String() string { func (e Element) String() string {
return fmt.Sprintf("<E'Cibo=%t Salute=%d Eta=%d>", e.IsFood, e.Health, e.Age) return fmt.Sprintf("E'Cibo=%t Salute=%d Eta=%d", e.IsFood, e.Health, e.Age)
} }
func Costruttore(razza string, evoluzione int, costomov int, costosex int, premura int, salute int) *Element { func Costruttore(razza string, evoluzione int, costomov int, costosex int, premura int, salute int) *Element {

View file

@ -1,7 +1,7 @@
<html> <html>
<head> <head>
<title>GoBug</title> <title>GoBug</title>
<meta http-equiv="refresh" content="{{ .tempoAggiorna }}"> <!--meta http-equiv="refresh" content="{{ .tempoAggiorna }}"-->
<meta charset="UTF-8"> <meta charset="UTF-8">
<style type="text/css"> <style type="text/css">
h1,h2,h3,h4 { h1,h2,h3,h4 {
@ -9,16 +9,13 @@
text-align: center; text-align: center;
font-size:2.4em; font-size:2.4em;
} }
p { p {
color: white; color: white;
font-size:2em; font-size:2em;
} }
body { body {
background: #009999; background: #009999;
} }
table { table {
border: 1px solid white; border: 1px solid white;
empty-cells: show; empty-cells: show;
@ -27,37 +24,33 @@
width:100%; width:100%;
height: 100%; height: 100%;
} }
div { div {
width:20%; width:20%;
height: 89%; height: 89%;
background-color: #006666; background-color: #006666;
} }
td,tr { td,tr {
background: white; background: white;
padding: 0px padding: 0px;
} }
.cibo {
td.cibo {
background: #FFFF33; background: #FFFF33;
padding: 0px padding: 0px;
} }
.razza1 {
td.razza1 {
background: #00ff00; background: #00ff00;
padding: 0px padding: 0px;
} }
.razza2 {
td.razza2 {
background: #FF0000; background: #FF0000;
padding: 0px padding: 0px;
} }
</style> </style>
</head> </head>
<body> <body>
<h1>Go bug</h1> <h1>Go bug</h1>
<div style="float:left; display:block; width:70%; height:89%; "> <div style="float:left; display:block; width:70%; height:89%; ">
<table>
{{range $riga := .matrice}} {{range $riga := .matrice}}
<tr> <tr>
{{range $cella := $riga}} {{range $cella := $riga}}
@ -69,8 +62,7 @@
{{ else }} {{ else }}
class="razza1" class="razza1"
{{ end }} {{ end }}
{{ end }} {{ end }}>{{ $cella }}</td>
>{{ $cella }}</td>
{{ end }} {{ end }}
</tr> </tr>
{{ end }} {{ end }}