aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhongheng Liu <z.liu@outlook.com.gr>2024-10-23 09:31:42 +0300
committerZhongheng Liu <z.liu@outlook.com.gr>2024-10-23 09:31:42 +0300
commit076c6964726296fcdd84cdbef5fa025e4db7eb2b (patch)
tree3e90088bbcf4ebf937f38d6bc4687f1d53d2e6f5
parent0040e130c18217acdea892674b00146f89865add (diff)
downloadrulmarc-076c6964726296fcdd84cdbef5fa025e4db7eb2b.tar.gz
rulmarc-076c6964726296fcdd84cdbef5fa025e4db7eb2b.tar.bz2
rulmarc-076c6964726296fcdd84cdbef5fa025e4db7eb2b.zip
chore: use formatter on Go files
-rw-r--r--main.go18
-rw-r--r--mknpcs.go26
2 files changed, 22 insertions, 22 deletions
diff --git a/main.go b/main.go
index 9e969ce..9cd4fac 100644
--- a/main.go
+++ b/main.go
@@ -23,7 +23,7 @@ func InputPrompt(scr *Window) string {
w.Box(0, 0)
Echo(true)
msg := "Game name: "
- w.MovePrint(0, 1, " New game information ")
+ w.MovePrint(0, 1, " New game information ")
w.MovePrint(2, 2, msg)
w.Move(2, 2+len(msg))
input, err := w.GetString(16) // character input box
@@ -32,7 +32,7 @@ func InputPrompt(scr *Window) string {
}
w.MovePrint(3, 2, input)
w.Refresh()
- Echo(false)
+ Echo(false)
for {
ch := w.GetChar()
switch Key(ch) {
@@ -52,14 +52,14 @@ func NewGame(scr *Window) {
}
my_npcs := MakeNpcs()
game.DataStored.Npcs = my_npcs
- scr.MovePrintf(1, 2, "Created new game \"%v\"!", game.SaveGame)
- for i:=0; i<len(game.DataStored.Npcs); i++ {
- scr.MovePrintf(2+i, 2, "Initialising \"%v\"...", game.DataStored.Npcs[i].Name)
- scr.MovePrintf(3+i, 2, "Found NPC query string!")
- scr.Refresh()
+ scr.MovePrintf(1, 2, "Created new game \"%v\"!", game.SaveGame)
+ for i := 0; i < len(game.DataStored.Npcs); i++ {
+ scr.MovePrintf(2+i, 2, "Initialising \"%v\"...", game.DataStored.Npcs[i].Name)
+ scr.MovePrintf(3+i, 2, "Found NPC query string!")
+ scr.Refresh()
- }
- // println(game.DataStored.Npcs[0].Name)
+ }
+ // println(game.DataStored.Npcs[0].Name)
}
func Continue(scr *Window) {
// recover state from last save?
diff --git a/mknpcs.go b/mknpcs.go
index 4655371..e6a0b9d 100644
--- a/mknpcs.go
+++ b/mknpcs.go
@@ -1,29 +1,29 @@
package main
import (
- . "gitlab.com/stvnliu/ai_game/utils/types"
+ . "gitlab.com/stvnliu/ai_game/utils/types"
)
func MakeNpcs() []Npc {
- npcs := []Npc {}
- helper01 := Npc{
+ npcs := []Npc{}
+ helper01 := Npc{
Name: "Helper01_NPC",
Ai: NpcAi{
PromptCharacterString: "You are a new helper assisting new players of a role-playing game set in $SCENE$, in a village called $VILLAGE$. With the information immediately preceeding, output only what you would say to a new player who just arrived in the village to provide helpful guidance.",
QueryFromTableName: "helper",
},
}
- npcs = append(npcs, helper01)
+ npcs = append(npcs, helper01)
- rulmarc := Npc {
- Name: "Rulmarc",
- Ai: NpcAi {
- PromptCharacterString: "You are a medieval villager called Rulmarc.",
- QueryFromTableName: "helper",
- },
- }
+ rulmarc := Npc{
+ Name: "Rulmarc",
+ Ai: NpcAi{
+ PromptCharacterString: "You are a medieval villager called Rulmarc.",
+ QueryFromTableName: "helper",
+ },
+ }
- npcs = append(npcs, rulmarc)
+ npcs = append(npcs, rulmarc)
- return npcs
+ return npcs
}