| 
														
															@@ -49,10 +49,11 @@ type PlayCards struct { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	Play_card           int 
														 | 
														
														 | 
														
															 	Play_card           int 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	Current_streak      int 
														 | 
														
														 | 
														
															 	Current_streak      int 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	Best_streak         int 
														 | 
														
														 | 
														
															 	Best_streak         int 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	Hand_streak         int 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	Month_streak        int 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	Select_card         int 
														 | 
														
														 | 
														
															 	Select_card         int 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	Score               int 
														 | 
														
														 | 
														
															 	Score               int 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	Play_day            time.Time 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	Play_day_t          int64 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	Play_day            DBDate 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	Days_played         int 
														 | 
														
														 | 
														
															 	Days_played         int 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	Hand                int 
														 | 
														
														 | 
														
															 	Hand                int 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	SpaceAceTriPeaks    door.Panel 
														 | 
														
														 | 
														
															 	SpaceAceTriPeaks    door.Panel 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -66,12 +67,13 @@ type PlayCards struct { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	State               []DeckType // [51]DeckType 
														 | 
														
														 | 
														
															 	State               []DeckType // [51]DeckType 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	Off_X               int 
														 | 
														
														 | 
														
															 	Off_X               int 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	Off_Y               int 
														 | 
														
														 | 
														
															 	Off_Y               int 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	Calendar_day_t      [31]int64 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	Calendar            door.Screen 
														 | 
														
														 | 
														
															 	Calendar            door.Screen 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	Calendar_panel_days [42]int // Where is each day positioned on the Calendar? 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	Calendar_panel_days [42]int // Where is each day positioned on the Calendar? 42 = 7 day * 6 lines 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	Calendar_day_status [31]int 
														 | 
														
														 | 
														
															 	Calendar_day_status [31]int 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+// Calendar_day        [31]DBDate // deprecate 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 // Possibly change Deck to [51]DeckType.  This game always only has 1 deck. 
														 | 
														
														 | 
														
															 // Possibly change Deck to [51]DeckType.  This game always only has 1 deck. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 // Possibly change State [51]DeckType to [51]int8. 
														 | 
														
														 | 
														
															 // Possibly change State [51]DeckType to [51]int8. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 // There are few states to track. 
														 | 
														
														 | 
														
															 // There are few states to track. 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -110,6 +112,11 @@ func (pc *PlayCards) InitValues() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	pc.Best_streak = 0 
														 | 
														
														 | 
														
															 	pc.Best_streak = 0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	best := pc.DB.GetSetting("best_streak", "0") 
														 | 
														
														 | 
														
															 	best := pc.DB.GetSetting("best_streak", "0") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	pc.Best_streak, _ = strconv.Atoi(best) 
														 | 
														
														 | 
														
															 	pc.Best_streak, _ = strconv.Atoi(best) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	pc.Month_streak = 0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	// Init the best streak for this month 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	// TODO: Pull from DB. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	pc.Hand_streak = 0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	// Best for this hand 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	pc.Select_card = 23 
														 | 
														
														 | 
														
															 	pc.Select_card = 23 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	pc.Score = 0 
														 | 
														
														 | 
														
															 	pc.Score = 0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -120,20 +127,21 @@ func (pc *PlayCards) Init() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	pc.InitValues() 
														 | 
														
														 | 
														
															 	pc.InitValues() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	// PlayCards::PlayCards() 
														 | 
														
														 | 
														
															 	// PlayCards::PlayCards() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	pc.Play_day = time.Now() 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	NormalizeDate(&pc.Play_day) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	pc.Play_day_t = pc.Play_day.Unix() 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	pc.Play_day = ToDBDate(time.Now()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	// NormalizeDate(&pc.Play_day) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	//pc.Play_day_t = pc.Play_day.Unix() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	pc.DeckPanel.Init() 
														 | 
														
														 | 
														
															 	pc.DeckPanel.Init() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	var last_played int64 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	var last_played DBDate 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	last := pc.DB.GetSetting("last_played", "0") 
														 | 
														
														 | 
														
															 	last := pc.DB.GetSetting("last_played", "0") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	last_played, _ = strconv.ParseInt(last, 10, 64) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	temp, _ := strconv.ParseInt(last, 10, 64) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	last_played = DBDate(temp) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	days := pc.DB.GetSetting("days_played", "0") 
														 | 
														
														 | 
														
															 	days := pc.DB.GetSetting("days_played", "0") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	pc.Days_played, _ = strconv.Atoi(days) 
														 | 
														
														 | 
														
															 	pc.Days_played, _ = strconv.Atoi(days) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	if last_played != pc.Play_day_t { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		pc.DB.SetSetting("last_played", strconv.FormatInt(pc.Play_day_t, 10)) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	if last_played != pc.Play_day { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		pc.DB.SetSetting("last_played", strconv.FormatInt(int64(pc.Play_day), 10)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		pc.DB.SetSetting("days_played", "0") 
														 | 
														
														 | 
														
															 		pc.DB.SetSetting("days_played", "0") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		pc.Days_played = 0 
														 | 
														
														 | 
														
															 		pc.Days_played = 0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	} 
														 | 
														
														 | 
														
															 	} 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -217,7 +225,7 @@ func (pc *PlayCards) Init() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			if !ok { 
														 | 
														
														 | 
														
															 			if !ok { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				format = "January 2" 
														 | 
														
														 | 
														
															 				format = "January 2" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			} 
														 | 
														
														 | 
														
															 			} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			txt := fmt.Sprintf("Playing: %s", pc.Play_day.Format(format)) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			txt := fmt.Sprintf("Playing: %s", DBDateTime(pc.Play_day).Format(format)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			txt += strings.Repeat(" ", W-len(txt)) 
														 | 
														
														 | 
														
															 			txt += strings.Repeat(" ", W-len(txt)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			return txt 
														 | 
														
														 | 
														
															 			return txt 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		} 
														 | 
														
														 | 
														
															 		} 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -236,11 +244,26 @@ func (pc *PlayCards) Init() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				UpdateF: currentUpdate, 
														 | 
														
														 | 
														
															 				UpdateF: currentUpdate, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				RenderF: svRender, 
														 | 
														
														 | 
														
															 				RenderF: svRender, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			}) 
														 | 
														
														 | 
														
															 			}) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		handUpdate := func() string { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			txt := fmt.Sprintf("Hand Streak   : %d", pc.Hand_streak) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			txt += strings.Repeat(" ", W-len(txt)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			return txt 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		pc.StreakPanel.Lines = append(pc.StreakPanel.Lines, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			door.Line{Text: handUpdate(), 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				UpdateF: handUpdate, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				RenderF: svRender, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			}) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		longestUpdate := func() string { 
														 | 
														
														 | 
														
															 		longestUpdate := func() string { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			txt := fmt.Sprintf("Longest Streak: %d", pc.Best_streak) 
														 | 
														
														 | 
														
															 			txt := fmt.Sprintf("Longest Streak: %d", pc.Best_streak) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			txt += strings.Repeat(" ", W-len(txt)) 
														 | 
														
														 | 
														
															 			txt += strings.Repeat(" ", W-len(txt)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			return txt 
														 | 
														
														 | 
														
															 			return txt 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		} 
														 | 
														
														 | 
														
															 		} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		// TODO: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		// Add:  This Month and This Hand values 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		// pc.Month_streak, pc.Hand_streak 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		pc.StreakPanel.Lines = append(pc.StreakPanel.Lines, 
														 | 
														
														 | 
														
															 		pc.StreakPanel.Lines = append(pc.StreakPanel.Lines, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			door.Line{Text: longestUpdate(), 
														 | 
														
														 | 
														
															 			door.Line{Text: longestUpdate(), 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				UpdateF: longestUpdate, 
														 | 
														
														 | 
														
															 				UpdateF: longestUpdate, 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -318,29 +341,45 @@ func (pc *PlayCards) Init() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	// calendar = make_calendar(); 
														 | 
														
														 | 
														
															 	// calendar = make_calendar(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	{ 
														 | 
														
														 | 
														
															 	{ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		pc.Calendar = door.Screen{} 
														 | 
														
														 | 
														
															 		pc.Calendar = door.Screen{} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		var month time.Time = time.Now() 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		var month DBDate = ToDBDate(time.Now()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		month.First() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		var today_day int = month.Day() 
														 | 
														
														 | 
														
															 		var today_day int = month.Day() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		FirstOfMonthDate(&month) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		// FirstOfMonthDate(&month) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		var month_end DBDate = month 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		month_end.Last() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		// clear out 
														 | 
														
														 | 
														
															 		// clear out 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		for x := range pc.Calendar_day_t { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			pc.Calendar_day_t[x] = 0 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		} 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		// pc.Calendar_day_t = make([]int64, 31) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		pc.Calendar_day_t[0] = month.Unix() 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		var First_Weekday int = int(month.Weekday()) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		var month_last_day = 0 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		var month_end time.Time = month 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		for { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			month_end = month_end.AddDate(0, 0, 1) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			NormalizeDate(&month_end) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			if month_end.Day() == 1 { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-				break 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			} else { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-				pc.Calendar_day_t[month_end.Day()-1] = month_end.Unix() 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-				month_last_day = month_end.Day() 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		/* 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			for x := range pc.Calendar_day { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				pc.Calendar_day[x] = 0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			} 
														 | 
														
														 | 
														
															 			} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		} 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			// pc.Calendar_day_t = make([]int64, 31) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			pc.Calendar_day[0] = month // .Unix() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		*/ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		var First_Weekday int = int(DBDateTime(month).Weekday()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		var month_last_day = month_end.Day() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		/* 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			var calendarDay DBDate = month 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			for x := 1; x <= month_last_day; x++ { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				calendarDay.SetDay(x) //  = DBDate((int(calendarDay) % 100) + x) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				pc.Calendar_day[x-1] = calendarDay 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		*/ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		// var month_end time.Time = month 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		/* 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			for { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				month_end = month_end.AddDate(0, 0, 1) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				NormalizeDate(&month_end) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				if month_end.Day() == 1 { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+					break 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				} else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+					pc.Calendar_day_t[month_end.Day()-1] = month_end.Unix() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+					month_last_day = month_end.Day() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		*/ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		// clear out 
														 | 
														
														 | 
														
															 		// clear out 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		for x := range pc.Calendar_panel_days { 
														 | 
														
														 | 
														
															 		for x := range pc.Calendar_panel_days { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -364,9 +403,9 @@ func (pc *PlayCards) Init() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		last_played := pc.DB.WhenPlayed() 
														 | 
														
														 | 
														
															 		last_played := pc.DB.WhenPlayed() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		for played, hands := range last_played { 
														 | 
														
														 | 
														
															 		for played, hands := range last_played { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			if played >= month.Unix() { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			if played >= month { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				// Ok, it is within the range 
														 | 
														
														 | 
														
															 				// Ok, it is within the range 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-				var played_day int = time.Unix(played, 0).Day() 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				var played_day int = played.Day() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				if hands < pc.Total_hands { 
														 | 
														
														 | 
														
															 				if hands < pc.Total_hands { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 					pc.Calendar_day_status[played_day-1] = 1 
														 | 
														
														 | 
														
															 					pc.Calendar_day_status[played_day-1] = 1 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				} else { 
														 | 
														
														 | 
														
															 				} else { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -389,7 +428,7 @@ func (pc *PlayCards) Init() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		} 
														 | 
														
														 | 
														
															 		} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		// Get current month as string 
														 | 
														
														 | 
														
															 		// Get current month as string 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		var current string = strings.ToUpper(CurrentMonth(month)) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		var current string = strings.ToUpper(CurrentMonth(DBDateTime(month))) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		if len(current) < 6 { 
														 | 
														
														 | 
														
															 		if len(current) < 6 { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			current = "  " + current + "  " 
														 | 
														
														 | 
														
															 			current = "  " + current + "  " 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		} 
														 | 
														
														 | 
														
															 		} 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -538,13 +577,13 @@ func (pc *PlayCards) Init() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 func (pc *PlayCards) Play() rune { 
														 | 
														
														 | 
														
															 func (pc *PlayCards) Play() rune { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	// this defaults (for now) to playing today (if unplayed). 
														 | 
														
														 | 
														
															 	// this defaults (for now) to playing today (if unplayed). 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	// Otherwise display calendar. 
														 | 
														
														 | 
														
															 	// Otherwise display calendar. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	pc.Play_day = time.Now() 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	NormalizeDate(&pc.Play_day) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	pc.Play_day = ToDBDate(time.Now()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	// NormalizeDate(&pc.Play_day) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	pc.Play_day_t = pc.Play_day.Unix() 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	played := pc.DB.HandsPlayedOnDay(pc.Play_day_t) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	// pc.Play_day_t = pc.Play_day.Unix() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	played := pc.DB.HandsPlayedOnDay(pc.Play_day) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	log.Printf("HandsPlayedOnDay(%d), %d", pc.Play_day_t, played) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	log.Printf("HandsPlayedOnDay(%d), %d", pc.Play_day, played) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	var r rune 
														 | 
														
														 | 
														
															 	var r rune 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	if played == 0 { 
														 | 
														
														 | 
														
															 	if played == 0 { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -570,13 +609,15 @@ func (pc *PlayCards) Play() rune { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 CALENDAR_UPDATE: 
														 | 
														
														 | 
														
															 CALENDAR_UPDATE: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	// pc.UpdateCalendarDays() 
														 | 
														
														 | 
														
															 	// pc.UpdateCalendarDays() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	month_t := pc.Calendar_day_t[0] 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	month_t := pc.Play_day // pc.Calendar_day[0] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	month_t.SetDay(1) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	last_played := pc.DB.WhenPlayed() 
														 | 
														
														 | 
														
															 	last_played := pc.DB.WhenPlayed() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	for played, hands := range last_played { 
														 | 
														
														 | 
														
															 	for played, hands := range last_played { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		if played >= month_t { 
														 | 
														
														 | 
														
															 		if played >= month_t { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			// Ok, it is within the range 
														 | 
														
														 | 
														
															 			// Ok, it is within the range 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			var played_day int = time.Unix(played, 0).Day() 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			var played_day int = played.Day() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			log.Printf("update: month_unix %d, played %d, hands %d (total %d)\n", 
														 | 
														
														 | 
														
															 			log.Printf("update: month_unix %d, played %d, hands %d (total %d)\n", 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				month_t, played_day, hands, pc.Total_hands) 
														 | 
														
														 | 
														
															 				month_t, played_day, hands, pc.Total_hands) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			if hands < pc.Total_hands { 
														 | 
														
														 | 
														
															 			if hands < pc.Total_hands { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -639,8 +680,8 @@ AGAIN: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		if status == 0 { 
														 | 
														
														 | 
														
															 		if status == 0 { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			// play full day 
														 | 
														
														 | 
														
															 			// play full day 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			pc.Hand = 1 
														 | 
														
														 | 
														
															 			pc.Hand = 1 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			pc.Play_day_t = pc.Calendar_day_t[number-1] 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			pc.Play_day = time.Unix(pc.Play_day_t, 0) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			pc.Play_day.SetDay(number) //  = pc.Calendar_day[number-1] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			// pc.Play_day = time.Unix(pc.Play_day_t, 0) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			r = pc.PlayCards() 
														 | 
														
														 | 
														
															 			r = pc.PlayCards() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			if r == 'D' { 
														 | 
														
														 | 
														
															 			if r == 'D' { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				goto CALENDAR_UPDATE 
														 | 
														
														 | 
														
															 				goto CALENDAR_UPDATE 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -649,9 +690,9 @@ AGAIN: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		} 
														 | 
														
														 | 
														
															 		} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		if status == 1 { 
														 | 
														
														 | 
														
															 		if status == 1 { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			// Play half day 
														 | 
														
														 | 
														
															 			// Play half day 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			pc.Play_day_t = pc.Calendar_day_t[number-1] 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			pc.Play_day = time.Unix(pc.Play_day_t, 0) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			played := pc.DB.HandsPlayedOnDay(pc.Play_day_t) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			pc.Play_day.SetDay(number) // = pc.Calendar_day[number-1] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			// pc.Play_day = time.Unix(pc.Play_day_t, 0) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+			played := pc.DB.HandsPlayedOnDay(pc.Play_day) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			if played < pc.Total_hands { 
														 | 
														
														 | 
														
															 			if played < pc.Total_hands { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				pc.Hand = played + 1 
														 | 
														
														 | 
														
															 				pc.Hand = played + 1 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				r = pc.PlayCards() 
														 | 
														
														 | 
														
															 				r = pc.PlayCards() 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -697,6 +738,8 @@ Next_Hand: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	pc.Select_card = 23 
														 | 
														
														 | 
														
															 	pc.Select_card = 23 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	pc.Score = 0 
														 | 
														
														 | 
														
															 	pc.Score = 0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	pc.Current_streak = 0 
														 | 
														
														 | 
														
															 	pc.Current_streak = 0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	pc.Hand_streak = 0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	// Don't touch Month_streak. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	// Use play day to seed RNG 
														 | 
														
														 | 
														
															 	// Use play day to seed RNG 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	{ 
														 | 
														
														 | 
														
															 	{ 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -708,7 +751,7 @@ Next_Hand: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			seed_seq = append(seed_seq, ba[:]...) 
														 | 
														
														 | 
														
															 			seed_seq = append(seed_seq, ba[:]...) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			// sha1.Sum(ba[:]) 
														 | 
														
														 | 
														
															 			// sha1.Sum(ba[:]) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		} 
														 | 
														
														 | 
														
															 		} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		pd := Int64toByteArray(pc.Play_day_t) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		pd := Int64toByteArray(int64(pc.Play_day)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		seed_seq = append(seed_seq, pd[:]...) 
														 | 
														
														 | 
														
															 		seed_seq = append(seed_seq, pd[:]...) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		// We also need the hand # that we're playing. 
														 | 
														
														 | 
														
															 		// We also need the hand # that we're playing. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		seed_seq = append(seed_seq, byte(pc.Hand)) 
														 | 
														
														 | 
														
															 		seed_seq = append(seed_seq, byte(pc.Hand)) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -825,9 +868,25 @@ Next_Hand: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			switch r { 
														 | 
														
														 | 
														
															 			switch r { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			case '\x0d': 
														 | 
														
														 | 
														
															 			case '\x0d': 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				// Next Card 
														 | 
														
														 | 
														
															 				// Next Card 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				var updateStreakPanel bool = false 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				if pc.Current_streak > pc.Hand_streak { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+					pc.Hand_streak = pc.Current_streak 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+					updateStreakPanel = true 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				if pc.Current_streak > pc.Month_streak { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+					pc.Month_streak = pc.Current_streak 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+					updateStreakPanel = true 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				if pc.Current_streak > pc.Best_streak { 
														 | 
														
														 | 
														
															 				if pc.Current_streak > pc.Best_streak { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 					pc.Best_streak = pc.Current_streak 
														 | 
														
														 | 
														
															 					pc.Best_streak = pc.Current_streak 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 					save_streak = true 
														 | 
														
														 | 
														
															 					save_streak = true 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+					updateStreakPanel = true 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+					// pc.Door.Write(pc.StreakPanel.Update()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				if updateStreakPanel { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 					pc.Door.Write(pc.StreakPanel.Update()) 
														 | 
														
														 | 
														
															 					pc.Door.Write(pc.StreakPanel.Update()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				} 
														 | 
														
														 | 
														
															 				} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -860,6 +919,9 @@ Next_Hand: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			case 'Q', 'q': 
														 | 
														
														 | 
														
															 			case 'Q', 'q': 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				// Possibly prompt here for [N]ext hand or [Q]uit 
														 | 
														
														 | 
														
															 				// Possibly prompt here for [N]ext hand or [Q]uit 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				// Odd:  It seems like streaks should be tracked in 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+				// one place -- when we play a card... 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				if pc.Current_streak > pc.Best_streak { 
														 | 
														
														 | 
														
															 				if pc.Current_streak > pc.Best_streak { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 					pc.Best_streak = pc.Current_streak 
														 | 
														
														 | 
														
															 					pc.Best_streak = pc.Current_streak 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 					pc.Door.Write(pc.StreakPanel.Update()) 
														 | 
														
														 | 
														
															 					pc.Door.Write(pc.StreakPanel.Update()) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -885,13 +947,13 @@ Next_Hand: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 				} else { 
														 | 
														
														 | 
														
															 				} else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 					if r == 'D' || r == 'Q' { 
														 | 
														
														 | 
														
															 					if r == 'D' || r == 'Q' { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 						if pc.Score >= 50 { 
														 | 
														
														 | 
														
															 						if pc.Score >= 50 { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-							pc.DB.SaveScore(time.Now().Unix(), pc.Play_day_t, pc.Hand, 0, pc.Score) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+							pc.DB.SaveScore(ToDBDate(time.Now()), pc.Play_day, pc.Hand, 0, pc.Hand_streak, pc.Score) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 						} 
														 | 
														
														 | 
														
															 						} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 						in_game = false 
														 | 
														
														 | 
														
															 						in_game = false 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 					} else { 
														 | 
														
														 | 
														
															 					} else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 						if r == 'N' { 
														 | 
														
														 | 
														
															 						if r == 'N' { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-							pc.DB.SaveScore(time.Now().Unix(), pc.Play_day_t, pc.Hand, 0, pc.Score) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+							pc.DB.SaveScore(ToDBDate(time.Now()), pc.Play_day, pc.Hand, 0, pc.Hand_streak, pc.Score) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 							pc.Hand++ 
														 | 
														
														 | 
														
															 							pc.Hand++ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 							goto Next_Hand 
														 | 
														
														 | 
														
															 							goto Next_Hand 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 						} 
														 | 
														
														 | 
														
															 						} 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -989,7 +1051,7 @@ Next_Hand: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 								pc.Door.Write(pc.ScorePanel.Update()) 
														 | 
														
														 | 
														
															 								pc.Door.Write(pc.ScorePanel.Update()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 								// Save Score 
														 | 
														
														 | 
														
															 								// Save Score 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-								pc.DB.SaveScore(time.Now().Unix(), pc.Play_day_t, pc.Hand, 1, pc.Score) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+								pc.DB.SaveScore(ToDBDate(time.Now()), pc.Play_day, pc.Hand, 1, pc.Hand_streak, pc.Score) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 								pc.NextQuitPanel.Update() 
														 | 
														
														 | 
														
															 								pc.NextQuitPanel.Update() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 								pc.Door.Write(pc.NextQuitPanel.Output()) 
														 | 
														
														 | 
														
															 								pc.Door.Write(pc.NextQuitPanel.Output()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 |