Hello community,

here is the log from the commit of package nudoku for openSUSE:Factory checked 
in at 2018-04-19 15:33:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nudoku (Old)
 and      /work/SRC/openSUSE:Factory/.nudoku.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "nudoku"

Thu Apr 19 15:33:27 2018 rev:3 rq:598488 version:1.0.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/nudoku/nudoku.changes    2016-07-16 
22:13:15.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.nudoku.new/nudoku.changes       2018-04-19 
15:33:29.373187256 +0200
@@ -1,0 +2,11 @@
+Thu Apr 19 10:16:32 UTC 2018 - [email protected]
+
+- Update to 1.0.0:
+  * Add 'mark' command to highlight the currently selected number
+    in all other cells. Thanks to James Warnock.
+  * Redesign commands display.
+  * Display how many hints a person used when the puzzle is solved.
+  * Update maintainer email and man page.
+  * Code cleanup
+
+-------------------------------------------------------------------

Old:
----
  nudoku-0.2.5.tar.gz

New:
----
  nudoku-1.0.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ nudoku.spec ++++++
--- /var/tmp/diff_new_pack.rqy43w/_old  2018-04-19 15:33:29.917164809 +0200
+++ /var/tmp/diff_new_pack.rqy43w/_new  2018-04-19 15:33:29.917164809 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package nudoku
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           nudoku
-Version:        0.2.5
+Version:        1.0.0
 Release:        0
 Summary:        Ncurses based sudoku game
 License:        GPL-3.0

++++++ nudoku-0.2.5.tar.gz -> nudoku-1.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nudoku-0.2.5/AUTHORS new/nudoku-1.0.0/AUTHORS
--- old/nudoku-0.2.5/AUTHORS    2016-06-07 17:46:02.000000000 +0200
+++ new/nudoku-1.0.0/AUTHORS    2018-04-19 12:09:58.000000000 +0200
@@ -1,5 +1,6 @@
 AUTHOR:
 
-Michael 'jubalh' Vetter: [email protected]
+Michael 'jubalh' Vetter: [email protected]
 Jacobo 'clinchergt' Del Vale
 Natalie 'flackbash' Prange: [email protected]
+James 'FamousJameous' Warnock: [email protected]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nudoku-0.2.5/ChangeLog new/nudoku-1.0.0/ChangeLog
--- old/nudoku-0.2.5/ChangeLog  1970-01-01 01:00:00.000000000 +0100
+++ new/nudoku-1.0.0/ChangeLog  2018-04-19 12:09:58.000000000 +0200
@@ -0,0 +1,7 @@
+0.2.5 to 1.0.0
+  * Add 'mark' command to highlight the currently selected number in all othre
+    cells. Thanks to James Warnock.
+  * Redesign commands display.
+  * Display how many hints a person used when the puzzle is solved.
+  * Update maintainer email and man page.
+  * Code cleanup
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nudoku-0.2.5/Makefile.am new/nudoku-1.0.0/Makefile.am
--- old/nudoku-0.2.5/Makefile.am        2016-06-07 17:46:02.000000000 +0200
+++ new/nudoku-1.0.0/Makefile.am        2018-04-19 12:09:58.000000000 +0200
@@ -1,2 +1,3 @@
 SUBDIRS = src
 dist_man_MANS = man/nudoku.6
+EXTRA_DIST = ChangeLog LICENSE README.md
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nudoku-0.2.5/README.md new/nudoku-1.0.0/README.md
--- old/nudoku-0.2.5/README.md  2016-06-07 17:46:02.000000000 +0200
+++ new/nudoku-1.0.0/README.md  2018-04-19 12:09:58.000000000 +0200
@@ -9,13 +9,31 @@
 #### Arch Linux ####
 I heard rumors of nudoku being in the 
[AUR](https://aur.archlinux.org/packages/nudoku-git/).
 
-#### Funtoo/Gentoo ####
-Add [strangeland-overlay](https://github.com/jubalh/strangeland-overlay).
+#### Debian and derivates ####
+Contained in official stable repositories since Debian Stretch.
 
-Then run:
+```
+apt-get install nudoku
+```
+
+#### EL 7 (CentOS/Oracle Linux/Scientific Linux/RedHat ####
+You need to enable the EPEL repository and run:
+
+```
+yum install nudoku
+```
+  
+#### Fedora ####
+nudoku is in the official Fedora repository since June 2016:
+
+```
+dnf install nudoku
+```
+
+#### Funtoo/Gentoo ####
+Contained in official repo since 2018-02-16. Before that you had to use 
[strangeland-overlay](https://github.com/jubalh/strangeland-overlay).
 
 ```
-emerge --sync
 emerge nudoku -a
 ```
 
@@ -23,10 +41,9 @@
 
 Since openSUSE Leap 42.1 (and Tumbleweed) you can find nudoku in the official 
repository.
 For others you need to add the `games` repo.
-On openSUSE 13.2 for example, you can do it like this:
 
 ```
-zypper ar http://download.opensuse.org/repositories/games/openSUSE_13.2/ games
+zypper ar obs://games games
 zypper in nudoku
 ```
 
@@ -37,7 +54,7 @@
 
 #### Compilation ####
 
-Get the lastest .tar.xz [release](https://github.com/jubalh/nudoku/releases) 
and extract it.
+Get the latest .tar.xz [release](https://github.com/jubalh/nudoku/releases) 
and extract it.
 Then run:
 
 ```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nudoku-0.2.5/configure.ac 
new/nudoku-1.0.0/configure.ac
--- old/nudoku-0.2.5/configure.ac       2016-06-07 17:46:02.000000000 +0200
+++ new/nudoku-1.0.0/configure.ac       2018-04-19 12:09:58.000000000 +0200
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([nudoku], [0.2.5], [[email protected]])
+AC_INIT([nudoku], [1.0.0], [[email protected]])
 AC_CONFIG_SRCDIR([src/main.c])
 AM_INIT_AUTOMAKE([foreign])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nudoku-0.2.5/man/nudoku.6 
new/nudoku-1.0.0/man/nudoku.6
--- old/nudoku-0.2.5/man/nudoku.6       2016-06-07 17:46:02.000000000 +0200
+++ new/nudoku-1.0.0/man/nudoku.6       2018-04-19 12:09:58.000000000 +0200
@@ -1,5 +1,5 @@
 .\" Manpage for nudoku.
-.TH man 6 "07 June 2016" "0.2.5" "nudoku man page"
+.TH man 6 "19 April 2018" "1.0.0" "nudoku man page"
 .SH NAME
 nudoku \- ncurses based sudoku game
 .SH SYNOPSIS
@@ -14,25 +14,29 @@
 
 Some keys need to be typed uppercase to prevent pressing them accidentally.
 
-.BR Q
-Quit nudoku.
-
-.BR r
-Redraw screen. In case you resized your terminal this will come handy.
-
 .BR c
 Gives feedback whether your solution is right. If you think you finished your 
sudoku press this key to make sure it is. You can also use this during the game 
to check if you have made any mistakes.
 
+.BR H
+The computer will fill in one number for you. If you are pretty close to 
finishing he might not want to help you.
+And if you did something wrong so far, he will not say anything.
+
+.BR m
+Toggle marks. If enabled, the number in the currently selected cell will be 
highlighted in all other cells they occur in.
+Only works when colors are enabled.
+
 .BR N
 Create a new puzzle.
 
+.BR Q
+Quit nudoku.
+
+.BR r
+Redraw screen. In case you resized your terminal this will come handy.
+
 .BR S
 Let the computer solve the puzzle.
 
-.BR H
-The computer will fill in one number for you. If you are pretty close to 
finishing he might not want to help you.
-And if you did something wrong so far, he will not say anything.
-
 .SH OPTIONS
 
 .BR \-h
@@ -57,4 +61,4 @@
 No known bugs.
 
 .SH AUTHOR
-Michael Vetter ([email protected])
+Michael Vetter ([email protected])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nudoku-0.2.5/src/main.c new/nudoku-1.0.0/src/main.c
--- old/nudoku-0.2.5/src/main.c 2016-06-07 17:46:02.000000000 +0200
+++ new/nudoku-1.0.0/src/main.c 2018-04-19 12:09:58.000000000 +0200
@@ -1,7 +1,9 @@
 /*
+vim: noexpandtab:ts=4:sts=4:sw=4
+
 nudoku
 
-Copyright (C) 2014 Michael "jubalh" Vetter - jubalh _a-t_ openmailbox.org
+Copyright (C) 2014 - 2018 Michael "jubalh" Vetter - jubalh _a-t_ iodoru.org
 
 LICENCE:
 This program is free software: you can redistribute it and/or modify
@@ -17,33 +19,35 @@
 */
 
 /* INCLUDES */
-#include <stdlib.h>            /* rand, srand */
-#include <unistd.h>            /* getopt */
-#include <ncurses.h>   /* ncurses */
-#include <time.h>              /* time */
-#include <string.h>            /* strcmp, strlen */
-#include "sudoku.h"            /* sudoku functions */
+#include <stdlib.h>                            /* rand, srand */
+#include <unistd.h>                            /* getopt */
+#include <ncurses.h>                   /* ncurses */
+#include <time.h>                              /* time */
+#include <string.h>                            /* strcmp, strlen */
+#include "sudoku.h"                            /* sudoku functions */
 
 /* DEFINES */
 //#define VERSION                              "0.1" //gets set via autotools
-#define GRID_LINES                     19
-#define GRID_COLS                      37
-#define GRID_Y                         3
-#define GRID_X                         3
-#define INFO_LINES                     19
-#define INFO_COLS                      20
-#define INFO_Y                         3
-#define INFO_X                         GRID_X + GRID_COLS + 5
-#define GRID_NUMBER_START_Y 1
-#define GRID_NUMBER_START_X 2
-#define GRID_LINE_DELTA                4
-#define GRID_COL_DELTA         2
-#define STATUS_LINES           1
-#define STATUS_COLS                    GRID_COLS + INFO_COLS
-#define STATUS_Y                       1
-#define STATUS_X                       GRID_X
-#define MAX_HINT_RANDOM_TRY    20
-#define SUDOKU_LENGTH          STREAM_LENGTH - 1
+#define GRID_LINES                             19
+#define GRID_COLS                              37
+#define GRID_Y                                 3
+#define GRID_X                                 3
+#define INFO_LINES                             19
+#define INFO_COLS                              20
+#define INFO_Y                                 3
+#define INFO_X                                 GRID_X + GRID_COLS + 5
+#define GRID_NUMBER_START_Y            1
+#define GRID_NUMBER_START_X            2
+#define GRID_LINE_DELTA                        4
+#define GRID_COL_DELTA                 2
+#define STATUS_LINES                   1
+#define STATUS_COLS                            GRID_COLS + INFO_COLS
+#define STATUS_Y                               1
+#define STATUS_X                               GRID_X
+#define MAX_HINT_RANDOM_TRY            20
+#define SUDOKU_LENGTH                  STREAM_LENGTH - 1
+#define COLOR_HIGHLIGHT                        4
+#define COLOR_HIGHLIGHT_CURSOR 5
 
 #ifdef DEBUG
 #define EXAMPLE_STREAM 
"4.....8.5.3..........7......2.....6.....8.4......1.......6.3.7.5..2.....1.4......"
@@ -52,7 +56,9 @@
 /* GLOBALS */
 static bool g_useColor = true;
 static bool g_playing = false;
-static char* g_provided_stream; /* in case of -s flag the user provides the 
sudoku stream */
+static bool g_useHighlights = false;
+static char* g_provided_stream;                                /* in case of 
-s flag the user provides the sudoku stream */
+static int g_hint_counter;
 static char plain_board[STREAM_LENGTH];
 static char user_board[STREAM_LENGTH];
 static DIFFICULTY g_level = D_EASY;
@@ -176,6 +182,10 @@
                        init_pair(2, COLOR_BLUE, COLOR_BLACK);
                        // user input color
                        init_pair(3, COLOR_CYAN, COLOR_BLACK);
+                       // Highlight color
+                       init_pair(COLOR_HIGHLIGHT, COLOR_BLACK, COLOR_WHITE);
+                       // Cursor highlight color
+                       init_pair(COLOR_HIGHLIGHT_CURSOR, COLOR_BLACK, 
COLOR_MAGENTA);
                }
                else
                {
@@ -259,28 +269,45 @@
                wattroff(infobox, A_BOLD|COLOR_PAIR(2));
                wattron(infobox, COLOR_PAIR(1));
        }
-       wprintw(infobox, "Commands\n");
-       wprintw(infobox, " Q - Quit\n");
-       wprintw(infobox, " r - Redraw\n");
+       wprintw(infobox, "Movement\n");
        wprintw(infobox, " h - Move left\n");
-       wprintw(infobox, " l - Move right\n");
        wprintw(infobox, " j - Move down\n");
        wprintw(infobox, " k - Move up\n");
-       wprintw(infobox, " x - Delete number\n");
+       wprintw(infobox, " l - Move right\n\n");
+       wprintw(infobox, "Commands\n");
        wprintw(infobox, " c - Check solution\n");
+       wprintw(infobox, " H - Give a hint\n");
+       if (g_useColor)
+       {
+               wprintw(infobox, " m - Toggle marks\n");
+       }
        wprintw(infobox, " N - New puzzle\n");
+       wprintw(infobox, " Q - Quit\n");
+       wprintw(infobox, " r - Redraw\n");
        wprintw(infobox, " S - Solve puzzle\n");
-       wprintw(infobox, " H - Give a hint\n");
+       wprintw(infobox, " x - Delete number\n");
        if (g_useColor)
+       {
                wattroff(infobox, COLOR_PAIR(1));
+       }
+}
+
+static int get_character_at_grid(char* board, int x, int y)
+{
+       int posx, posy;
+       posy = (y-GRID_NUMBER_START_Y)/GRID_COL_DELTA;
+       posx = (x-GRID_NUMBER_START_X)/GRID_LINE_DELTA;
+       return board[posy*9+posx];
 }
 
-static void fill_grid(char *board)
+static void fill_grid(char *board, int x_cursor, int y_cursor)
 {
        int row, col, x, y;
        int n;
        int c;
+       int selected;
 
+       selected = get_character_at_grid(board, x_cursor, y_cursor);
        wstandend(grid);
        y = GRID_NUMBER_START_Y;
        for(row=0; row < 9; row++)
@@ -293,7 +320,21 @@
                                c = ' ';
                        else
                                c = n;
+                       if (g_useColor && g_useHighlights && selected == c)
+                       {
+                               if (x == x_cursor && y == y_cursor)
+                                       wattron(grid, 
COLOR_PAIR(COLOR_HIGHLIGHT_CURSOR));
+                               else
+                                       wattron(grid, 
COLOR_PAIR(COLOR_HIGHLIGHT));
+                       }
                        mvwprintw(grid, y, x, "%c", c);
+                       if (g_useColor && g_useHighlights && selected == c)
+                       {
+                               if (x == x_cursor && y == y_cursor)
+                                       wattroff(grid, 
COLOR_PAIR(COLOR_HIGHLIGHT_CURSOR));
+                               else
+                                       wattroff(grid, 
COLOR_PAIR(COLOR_HIGHLIGHT));
+                       }
                        x += GRID_LINE_DELTA;
                }
                y += GRID_COL_DELTA;
@@ -317,7 +358,7 @@
        if (!g_provided_stream)
                free(stream);
 
-       fill_grid(plain_board);
+       fill_grid(plain_board, GRID_NUMBER_START_X, GRID_NUMBER_START_Y);
 
        g_playing = true;
 }
@@ -348,7 +389,7 @@
 
 int main(int argc, char *argv[])
 {
-       bool run = true;
+       bool run = true, enable_highlights=false;
        int key, x, y, posx, posy;
 
        g_provided_stream = NULL;
@@ -361,7 +402,7 @@
 #ifdef DEBUG
        strcpy(plain_board, EXAMPLE_STREAM);
        strcpy(user_board, EXAMPLE_STREAM);
-       fill_grid(plain_board);
+       fill_grid(plain_board, GRID_NUMBER_START_X, GRID_NUMBER_START_Y);
        g_playing = true;
 #else
        new_puzzle();
@@ -389,22 +430,51 @@
                        case 'h':
                        case KEY_LEFT:
                                if(x>5)
+                               {
                                        x -= GRID_LINE_DELTA;
+                                       if(g_playing)
+                                       {
+                                               // if we have highlighting 
enabled, we need to redraw the whole grid
+                                               // so we can have the new 
colors in the matching colors.
+                                               // this should only be done 
when we are playing, because plain_board
+                                               // is actually the one being 
solved and thus displayed.
+                                               // this is true for all 
movement keys.
+                                               fill_grid(user_board, x, y);
+                                       }
+                               }
                                break;
                        case 'l':
                        case KEY_RIGHT:
                                if(x<34)
+                               {
                                        x += GRID_LINE_DELTA;
+                                       if(g_playing)
+                                       {
+                                               fill_grid(user_board, x, y);
+                                       }
+                               }
                                break;
                        case 'k':
                        case KEY_UP:
                                if(y>2)
+                               {
                                        y -= GRID_COL_DELTA;
+                                       if(g_playing)
+                                       {
+                                               fill_grid(user_board, x, y);
+                                       }
+                               }
                                break;
                        case 'j':
                        case KEY_DOWN:
                                if(y<17)
+                               {
                                        y += GRID_COL_DELTA;
+                                       if(g_playing)
+                                       {
+                                               fill_grid(user_board, x, y);
+                                       }
+                               }
                                break;
                        case 'Q':
                        case 27:
@@ -418,18 +488,22 @@
                        case 'S':
                                if(g_playing)
                                {
+                                       g_useHighlights = false;
                                        werase(status);
                                        mvwprintw(status, 0, 0, "Solving 
puzzle...");
                                        refresh();
                                        wrefresh(status);
                                        solve(plain_board);
-                                       fill_grid(plain_board);
+                                       fill_grid(plain_board, x, y);
                                        werase(status);
-                                       mvwprintw(status, 0, 0, "Solved!");
+                                       mvwprintw(status, 0, 0, "Solved");
                                        g_playing = false;
                                }
                                break;
                        case 'N':
+                               g_useHighlights = false;
+                               g_hint_counter = 0;
+
                                werase(status);
                                mvwprintw(status, 0, 0, "Generating puzzle...");
                                refresh();
@@ -463,7 +537,15 @@
                                        {
                                                if (strchr(user_board, '.') == 
NULL)
                                                {
-                                                       mvwprintw(status, 0, 0, 
"Solved!");
+                                                       mvwprintw(status, 0, 0, 
"Solved");
+
+                                                       if (g_hint_counter > 0)
+                                                       {
+                                                               char t[256];
+                                                               sprintf(t, " 
with the help of %d hints", g_hint_counter);
+                                                               
mvwprintw(status, 0, 6, t);
+                                                       }
+
                                                        g_playing = false;
                                                }
                                                else
@@ -493,11 +575,20 @@
                        case 'H':
                                if (g_playing && hint())
                                {
-                                       fill_grid(user_board);
+                                       g_hint_counter++;
+                                       fill_grid(user_board, x, y);
                                        werase(status);
                                        mvwprintw(status, 0, 0, "Provided 
hint");
                                }
                                break;
+                       case 'm':
+                               // Ignore 'm' if we have no colors
+                               if (g_useColor)
+                               {
+                                       g_useHighlights = !g_useHighlights;
+                                       fill_grid(user_board, x, y);
+                               }
+                               break;
                        default:
                                break;
                }
@@ -510,10 +601,9 @@
                        if(plain_board[posy*9+posx] == '.')
                        {
                                // add inputted number to grid
-                               wattron(grid, COLOR_PAIR(3));
-                               wprintw(grid, "%c", key);
-                               wattroff(grid, COLOR_PAIR(3));
                                user_board[posy*9+posx] = key;
+                               // redraw grid to update highlight
+                               fill_grid(user_board, x, y);
                        }
                }
                wmove(grid, y,x);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nudoku-0.2.5/src/sudoku.c 
new/nudoku-1.0.0/src/sudoku.c
--- old/nudoku-0.2.5/src/sudoku.c       2016-06-07 17:46:02.000000000 +0200
+++ new/nudoku-1.0.0/src/sudoku.c       2018-04-19 12:09:58.000000000 +0200
@@ -1,7 +1,9 @@
 /*
+vim: noexpandtab:ts=4:sts=4:sw=4
+
 nudoku
 
-Copyright (C) 2014 Michael "jubalh" Vetter - jubalh _a-t_ openmailbox.org
+Copyright (C) 2014 - 2018 Michael "jubalh" Vetter - jubalh _a-t_ iodoru.org
 
 LICENCE:
 This program is free software: you can redistribute it and/or modify
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nudoku-0.2.5/src/sudoku.h 
new/nudoku-1.0.0/src/sudoku.h
--- old/nudoku-0.2.5/src/sudoku.h       2016-06-07 17:46:02.000000000 +0200
+++ new/nudoku-1.0.0/src/sudoku.h       2018-04-19 12:09:58.000000000 +0200
@@ -1,3 +1,5 @@
+// vim: noexpandtab:ts=4:sts=4:sw=4
+
 #ifndef SUDOKU_H
 #define SUDOKU_H
 


Reply via email to