Gnome mines scoring take #2.



This is another suggestion for doing scores in gnome mines


I think it works this time, but there may well be funny combinations
that
break this scheme.

Cheers
Kjartan
--- Makefile.am	Fri May 22 16:00:15 1998
+++ Makefile.am.new	Thu May 21 21:38:09 1998
@@ -26,7 +26,16 @@
 
 install-data-local:
 	-$(mkinstalldirs) $(scoredir)
-	-touch $(scoredir)/gnomine.scores
-	-chown games.games $(scoredir)/gnomine.scores
-	-chmod 664 $(scoredir)/gnomine.scores
+	-touch $(scoredir)/gnomine.Tiny.scores
+	-chown games.games $(scoredir)/gnomine.Tiny.scores
+	-chmod 664 $(scoredir)/gnomine.Tiny.scores	
+	-touch $(scoredir)/gnomine.Medium.scores
+	-chown games.games $(scoredir)/gnomine.Medium.scores
+	-chmod 664 $(scoredir)/gnomine.Medium.scores	
+	-touch $(scoredir)/gnomine.Biiiig.scores
+	-chown games.games $(scoredir)/gnomine.Biiiig.scores
+	-chmod 664 $(scoredir)/gnomine.Biiiig.scores	
+	-touch $(scoredir)/gnomine.Custom.scores
+	-chown games.games $(scoredir)/gnomine.Custom.scores
+	-chmod 664 $(scoredir)/gnomine.Custom.scores	
 	-chgrp games $(bindir)/gnomine && chmod 2111 $(bindir)/gnomine
--- gnomine.c.old	Thu May 21 21:54:52 1998
+++ gnomine.c	Fri May 22 19:10:00 1998
@@ -69,6 +69,7 @@
 	N_("Tiny"),
 	N_("Medium"),
 	N_("Biiiig"),
+	N_("Custom"),
 };
 
 void show_face(GtkWidget *pm)
@@ -113,10 +114,8 @@
 {
 	gchar buf[64];
 
-	if(fsize<3)
+	if(fsize<4)
 		strncpy(buf, fsize2names[fsize], sizeof(buf));
-	else
-		g_snprintf(buf, sizeof(buf), "%dx%dx%d",xsize,ysize,nmines);
 
 	show_scores(buf, 0);
 }
@@ -157,18 +156,20 @@
         int pos;
         gchar buf[64];
 
-        show_face(pm_win);
         gtk_clock_stop(GTK_CLOCK(clk));
+        show_face(pm_win);
 
-	score = (gfloat) (GTK_CLOCK(clk)->stopped / 60) + 
-		(gfloat) (GTK_CLOCK(clk)->stopped % 60) / 100; 
+	if(fsize<3) 
+	    score = (gfloat) (GTK_CLOCK(clk)->stopped / 60) + 
+		    (gfloat) (GTK_CLOCK(clk)->stopped % 60) / 100;
+
+	else  
+	    score = ((nmines * 100) / (xsize * ysize)) /
+		    (gfloat) (GTK_CLOCK(clk)->stopped); 
 
-	if(fsize<3)
-		strncpy(buf, fsize2names[fsize], sizeof(buf));
-	else
-		g_snprintf(buf, sizeof(buf), "%dx%dx%d",xsize,ysize,nmines);
-
-	pos = gnome_score_log(score, buf, FALSE);
+        strncpy(buf, fsize2names[fsize], sizeof(buf));
+	pos = gnome_score_log(score, buf, TRUE);
+	
 	show_scores(buf, pos);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]