github.com/archlabjp/eeslism-go@v0.0.0-20231109122333-4bb7bfcdf292/eeslism/dbgpri2.go (about) 1 //This file is part of EESLISM. 2 // 3 //Foobar is free software : you can redistribute itand /or modify 4 //it under the terms of the GNU General Public License as published by 5 //the Free Software Foundation, either version 3 of the License, or 6 //(at your option) any later version. 7 // 8 //Foobar is distributed in the hope that it will be useful, 9 //but WITHOUT ANY WARRANTY; without even the implied warranty of 10 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 11 //GNU General Public License for more details. 12 // 13 //You should have received a copy of the GNU General Public License 14 //along with Foobar.If not, see < https://www.gnu.org/licenses/>. 15 16 /* dbgpri2.c */ 17 18 package eeslism 19 20 import "fmt" 21 22 /* ----------------------------------------- */ 23 func xprroom(R []*ROOM) { 24 var j int 25 var ARN []float64 26 var RMP []float64 27 var Room *ROOM 28 29 Room = R[0] 30 if DEBUG { 31 fmt.Println("--- xprroom") 32 for i := range R { 33 Room = R[i] 34 fmt.Printf(" Room: name=%s MRM=%f GRM=%f\n", Room.Name, Room.MRM, Room.GRM) 35 fmt.Printf(" RMt=%f", Room.RMt) 36 37 ARN = Room.ARN 38 for j = 0; j < Room.Ntr; j++ { 39 fmt.Printf(" ARN=%f", ARN[j]) 40 } 41 42 RMP = Room.RMP 43 for j = 0; j < Room.Nrp; j++ { 44 fmt.Printf(" RMP=%f", RMP[j]) 45 } 46 47 fmt.Printf(" RMC=%f\n", Room.RMC) 48 fmt.Printf(" RMx=%f RMXC=%f\n", Room.RMx, Room.RMXC) 49 } 50 } 51 52 Room = R[0] 53 if Ferr != nil { 54 fmt.Fprintln(Ferr, "--- xprroom") 55 for i := range R { 56 Room = R[i] 57 fmt.Fprintf(Ferr, "Room:\tname=%s\tMRM=%.4g\tGRM=%.4g\n", Room.Name, Room.MRM, Room.GRM) 58 fmt.Fprintf(Ferr, "\tRMt=%.4g\n", Room.RMt) 59 60 ARN = Room.ARN 61 for j = 0; j < Room.Ntr; j++ { 62 fmt.Fprintf(Ferr, "\tARN[%d]=%.4g", j, ARN[j]) 63 } 64 fmt.Fprintln(Ferr) 65 66 RMP = Room.RMP 67 for j = 0; j < Room.Nrp; j++ { 68 fmt.Fprintf(Ferr, "\tRMP[%d]=%.4g", j, RMP[j]) 69 } 70 fmt.Fprintln(Ferr) 71 72 fmt.Fprintf(Ferr, "\tRMC=%.4g\n", Room.RMC) 73 fmt.Fprintf(Ferr, "\tRMx=%.2g\t\tRMXC=%.2g\n", Room.RMx, Room.RMXC) 74 } 75 } 76 } 77 78 /* ----------------------------------------- */ 79 80 func xprschval(val []float64, isw []ControlSWType) { 81 fmt.Println("--- xprschval") 82 83 for j := range val { 84 fmt.Printf("--- val=(%d) %f\n", j, val[j]) 85 } 86 87 for j := range isw { 88 fmt.Printf("--- isw=(%d) %c\n", j, isw[j]) 89 } 90 } 91 92 /* --------------------------------------------- */ 93 94 func xprqin(Room []*ROOM) { 95 fmt.Printf("--- xprqin Nroom=%d\n", len(Room)) 96 97 for i := range Room { 98 r := Room[i] 99 fmt.Printf(" [%d] Hc=%f Hr=%f HL=%f Lc=%f Lr=%f Ac=%f Ar=%f AL=%f\n", 100 i, r.Hc, r.Hr, r.HL, r.Lc, r.Lr, r.Ac, r.Ar, r.AL) 101 } 102 } 103 104 /* --------------------------------------------- */ 105 106 func xprvent(R []*ROOM) { 107 var j int 108 var A *ACHIR 109 var Room *ROOM 110 111 if DEBUG { 112 fmt.Println("--- xprvent") 113 114 for i := range R { 115 Room = R[i] 116 fmt.Printf(" [%d] %-10s Gvent=%f -- Gvr:", i, Room.Name, Room.Gvent) 117 118 for j = 0; j < Room.Nachr; j++ { 119 A = Room.achr[j] 120 fmt.Printf(" <%d>=%f", A.rm, A.Gvr) 121 } 122 fmt.Println() 123 } 124 } 125 126 if Ferr != nil { 127 fmt.Fprintln(Ferr, "\n\n--- xprvent") 128 129 for i := range R { 130 Room = R[i] 131 fmt.Fprintf(Ferr, "\t[%d]\t%s\tGvent=%.3g\n\t\t", i, Room.Name, Room.Gvent) 132 133 for j = 0; j < Room.Nachr; j++ { 134 A = Room.achr[j] 135 fmt.Fprintf(Ferr, "\t<%d>=%.2g", A.rm, A.Gvr) 136 } 137 fmt.Fprintln(Ferr) 138 } 139 } 140 }