UI finished
This commit is contained in:
parent
d931d9027c
commit
1610bf2467
9 changed files with 96 additions and 14 deletions
5
main.go
5
main.go
|
@ -79,6 +79,11 @@ func main() {
|
||||||
|
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
|
"total": 8787,
|
||||||
|
"aiWon": 232,
|
||||||
|
"aiWonPercent": "3.5%",
|
||||||
|
"draw": 6777,
|
||||||
|
"drawPercent": "94.4%",
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
25
views/about.en.html
Normal file
25
views/about.en.html
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<p>
|
||||||
|
<strong>A small project to test pseudo AI on Tic Tac Toe.</strong>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Main idea was to train AI by playing game. AI has wining games datebase and select next click by selecting next step from already plaied game. In the last results AI should never lose.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Another idea was for myself to get some trainings on go programming language.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Project written on GPL3 license <img src="https://www.gnu.org/graphics/gplv3-127x51.png" height="18"> what you can get <a href="https://www.gnu.org/licenses/gpl-3.0.html" target="_blank">here</a>. Project source are <a href="https://g.arns.lt/zordsdavini/tic-tac-toe" target="_blank">https://g.arns.lt/zordsdavini/tic-tac-toe</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3>About myself</h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
I am Arns Udovič from Lithuania. You can follow me on fediverse <img src="https://cdn.fosstodon.org/custom_emojis/images/000/691/237/static/fe937eadd5c9cb08.png" height="18"> at <a href="https://s.arns.lt/@zordsdavini" target="_blank">@zordsdavini@s.arns.lt</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a href="https://www.buymeacoffee.com/zordsdavini" target="_blank" rel="nofollow noopener"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" height="40px"></a>
|
||||||
|
</p>
|
25
views/about.sgs.html
Normal file
25
views/about.sgs.html
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<p>
|
||||||
|
<strong>Mažos pruojektoks patestoutė pseudo DI so Krīžioku-Nulioku žaidėmo.</strong>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Pėrmuojė idiejė bova ėšmuokintė DI žaidont žaidėma. DI tor vėsus laimietus žaidėmus duombazie ė pajem sekonti ējėma ėš jau sožaistū žaidėmu. Galotėniam rezoltatė DI turietom nabpralaimietė.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Kėta idiejė bova pasėtrenėroutė mon patiam ont Go programavėma kalbuos.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Pruojekts parašīts ont GPL3 licenzėjės <img src="https://www.gnu.org/graphics/gplv3-127x51.png" height="18">, katron galat gautė ėš <a href="https://www.gnu.org/licenses/gpl-3.0.html" target="_blank">če (onglėškā)</a>. Pruojekta kuods īr <a href="https://g.arns.lt/zordsdavini/tic-tac-toe" target="_blank">https://g.arns.lt/zordsdavini/tic-tac-toe</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3>Aple monėm pati</h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Eso Udovič Arns. Galat monėm sektė fediversė <img src="https://cdn.fosstodon.org/custom_emojis/images/000/691/237/static/fe937eadd5c9cb08.png" height="18"> <a href="https://s.arns.lt/@zordsdavini" target="_blank">@zordsdavini@s.arns.lt</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a href="https://www.buymeacoffee.com/zordsdavini" target="_blank" rel="nofollow noopener"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" height="40px"></a>
|
||||||
|
</p>
|
|
@ -52,5 +52,9 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<b>Game:</b> {{.gameFlow}}
|
{{ if eq .lang "sgs"}}
|
||||||
|
{{include "statistics.sgs"}}
|
||||||
|
{{ else }}
|
||||||
|
{{include "statistics.en"}}
|
||||||
|
{{ end }}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -17,7 +17,18 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
{{template "content" .}}
|
{{template "content" .}}
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
{{ if eq .lang "sgs"}}
|
||||||
|
{{include "about.sgs"}}
|
||||||
|
{{ else }}
|
||||||
|
{{include "about.en"}}
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{{include "layouts/footer"}}
|
{{include "layouts/footer"}}
|
||||||
|
|
6
views/statistics.en.html
Normal file
6
views/statistics.en.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<p>
|
||||||
|
<b>Game:</b> {{.gameFlow}}<br>
|
||||||
|
<b>Total plaied:</b> {{.total}}<br>
|
||||||
|
<b>AI Won:</b> {{.aiWon}} {{.aiWonPercent}}<br>
|
||||||
|
<b>Draw:</b> {{.draw}} {{.drawPercent}}<br>
|
||||||
|
</p>
|
6
views/statistics.sgs.html
Normal file
6
views/statistics.sgs.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<p>
|
||||||
|
<b>Žaidėms:</b> {{.gameFlow}}<br>
|
||||||
|
<b>Ėš vėsa žaidėmu:</b> {{.total}}<br>
|
||||||
|
<b>Laimiejė DI:</b> {{.aiWon}} {{.aiWonPercent}}<br>
|
||||||
|
<b>Līgiuoms:</b> {{.draw}} {{.drawPercent}}<br>
|
||||||
|
</p>
|
|
@ -9,7 +9,7 @@
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a class="btn btn-secondary" href="/{{.lang}}/1">Me first!</a>
|
<a class="btn btn-secondary" href="/{{.lang}}/1/0">Me first!</a>
|
||||||
<a class="btn btn-secondary" href="/{{.lang}}/0/x">AI first</a>
|
<a class="btn btn-secondary" href="/{{.lang}}/0/x">AI first</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a class="btn btn-secondary" href="/{{.lang}}/1">Aš pėrms!</a>
|
<a class="btn btn-secondary" href="/{{.lang}}/1/0">Aš pėrms!</a>
|
||||||
<a class="btn btn-secondary" href="/{{.lang}}/0/x">DI pėrms</a>
|
<a class="btn btn-secondary" href="/{{.lang}}/0/x">DI pėrms</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue