Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package nudoku for openSUSE:Factory checked in at 2024-04-28 21:51:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/nudoku (Old) and /work/SRC/openSUSE:Factory/.nudoku.new.1880 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nudoku" Sun Apr 28 21:51:19 2024 rev:8 rq:1170591 version:4.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/nudoku/nudoku.changes 2023-12-21 23:39:24.620283236 +0100 +++ /work/SRC/openSUSE:Factory/.nudoku.new.1880/nudoku.changes 2024-04-29 08:15:33.099395174 +0200 @@ -1,0 +2,7 @@ +Sun Apr 28 14:25:56 UTC 2024 - Michael Vetter <mvet...@suse.com> + +- Update to 4.0.0: + * Add Turkish translation (pr #57) + * Add undo feature (pr #58) + +------------------------------------------------------------------- Old: ---- nudoku-3.0.0.tar.gz New: ---- nudoku-4.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nudoku.spec ++++++ --- /var/tmp/diff_new_pack.xn67VR/_old 2024-04-29 08:50:54.148310069 +0200 +++ /var/tmp/diff_new_pack.xn67VR/_new 2024-04-29 08:50:54.152310214 +0200 @@ -1,7 +1,7 @@ # # spec file for package nudoku # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # 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: 3.0.0 +Version: 4.0.0 Release: 0 Summary: Ncurses based sudoku game License: GPL-3.0-only ++++++ nudoku-3.0.0.tar.gz -> nudoku-4.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nudoku-3.0.0/ChangeLog new/nudoku-4.0.0/ChangeLog --- old/nudoku-3.0.0/ChangeLog 2023-12-21 11:44:39.000000000 +0100 +++ new/nudoku-4.0.0/ChangeLog 2024-04-28 16:22:15.000000000 +0200 @@ -1,3 +1,7 @@ +3.0.0 to 4.0.0 (2024-04-28) + * Add Turkish translation (pr #57) + * Add undo feature (p3 #58) + 2.1.0 to 3.0.0 (2023-12-21) * Fix build failure with ncurses 6.3 * Add call to PKG_PROG_PKG_CONFIG and pkg-check ncurses libs #46 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nudoku-3.0.0/configure.ac new/nudoku-4.0.0/configure.ac --- old/nudoku-3.0.0/configure.ac 2023-12-21 11:44:39.000000000 +0100 +++ new/nudoku-4.0.0/configure.ac 2024-04-28 16:22:15.000000000 +0200 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([nudoku], [3.0.0], [jub...@iodoru.org]) +AC_INIT([nudoku], [4.0.0], [jub...@iodoru.org]) AC_CONFIG_SRCDIR([src/main.c]) AM_INIT_AUTOMAKE([foreign]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nudoku-3.0.0/man/nudoku.6 new/nudoku-4.0.0/man/nudoku.6 --- old/nudoku-3.0.0/man/nudoku.6 2023-12-21 11:44:39.000000000 +0100 +++ new/nudoku-4.0.0/man/nudoku.6 2024-04-28 16:22:15.000000000 +0200 @@ -1,5 +1,5 @@ .\" Manpage for nudoku. -.TH man 6 "21 December 2023" "3.0.0" "nudoku man page" +.TH man 6 "28 April 2024" "4.0.0" "nudoku man page" .SH NAME nudoku \- ncurses based sudoku game .SH SYNOPSIS @@ -37,6 +37,12 @@ .BR S Let the computer solve the puzzle. +.BR x +Delete number from field. + +.BR u +Undo previous action. + .SH OPTIONS .BR \-h diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nudoku-3.0.0/po/LINGUAS new/nudoku-4.0.0/po/LINGUAS --- old/nudoku-3.0.0/po/LINGUAS 2023-12-21 11:44:39.000000000 +0100 +++ new/nudoku-4.0.0/po/LINGUAS 2024-04-28 16:22:15.000000000 +0200 @@ -3,3 +3,4 @@ ru fr ja +tr diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nudoku-3.0.0/po/tr.po new/nudoku-4.0.0/po/tr.po --- old/nudoku-3.0.0/po/tr.po 1970-01-01 01:00:00.000000000 +0100 +++ new/nudoku-4.0.0/po/tr.po 2024-04-28 16:22:15.000000000 +0200 @@ -0,0 +1,190 @@ +# Turkish translations for nudoku package. +# This file is distributed under the same license as the nudoku package. +# OÄuz Ersen <o...@ersen.moe>, 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: nudoku 1.0.0\n" +"Report-Msgid-Bugs-To: jub...@iodoru.org\n" +"POT-Creation-Date: 2018-04-27 19:00-0300\n" +"PO-Revision-Date: 2024-03-29 19:50+0300\n" +"Last-Translator: OÄuz Ersen <o...@ersen.moe>\n" +"Language-Team: Turkish <tr>\n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Gtranslator 45.3\n" + +#: src/main.c:84 +#, c-format +msgid "" +"nudoku [option]\n" +"\n" +msgstr "" +"nudoku [seçenek]\n" +"\n" + +#: src/main.c:85 +#, c-format +msgid "Options:\n" +msgstr "Seçenekler:\n" + +#: src/main.c:86 +#, c-format +msgid "-h help:\t\tPrint this help\n" +msgstr "-h:\t\tYardım metnini yazdır\n" + +#: src/main.c:87 +#, c-format +msgid "-v version:\t\tPrint version\n" +msgstr "-v:\t\tSürüm numarasını yazdır\n" + +#: src/main.c:88 +#, c-format +msgid "-c nocolor:\t\tDo not use colors\n" +msgstr "-c:\t\tRenkler kullanılmasın\n" + +#: src/main.c:89 +#, c-format +msgid "-d difficulty:\t\tChoose between: easy, normal, hard\n" +msgstr "-d zorluk:\t\tZorluk derecesini seç: easy, normal, hard\n" + +#: src/main.c:90 +#, c-format +msgid "-s stream:\t\tUser provided sudoku stream\n" +msgstr "-s tahta:\t\tBelirtilen sudoku tahtasını kullan\n" + +#: src/main.c:104 +#, c-format +msgid "Character %c at position %d is not allowed.\n" +msgstr "%c karakterine %d konumunda izin verilmiyor.\n" + +#: src/main.c:112 +#, c-format +msgid "Stream has to be %d characters long.\n" +msgstr "Tahta %d karakter uzunluÄunda olmalıdır.\n" + +#: src/main.c:118 +#, c-format +msgid "Stream does not represent a valid sudoku puzzle.\n" +msgstr "Tahta geçerli bir sudoku bulmacası deÄil.\n" + +#: src/main.c:147 +msgid "easy" +msgstr "kolay" + +#: src/main.c:149 +msgid "normal" +msgstr "normal" + +#: src/main.c:151 +msgid "hard" +msgstr "zor" + +#: src/main.c:195 +msgid "" +"Your terminal doesn't support colors.\n" +"Try the nocolor (-c) option.\n" +msgstr "" +"Terminaliniz renkleri desteklemiyor.\n" +"Renksiz (-c) seçeneÄini deneyin.\n" + +#: src/main.c:266 +#, c-format +msgid "" +"level: %s\n" +"\n" +msgstr "" +"seviye: %s\n" +"\n" + +#: src/main.c:275 +msgid "Movement\n" +msgstr "Hareket\n" + +#: src/main.c:276 +msgid " h - Move left\n" +msgstr " h - Sola git\n" + +#: src/main.c:277 +msgid " j - Move down\n" +msgstr " j - AÅaÄı git\n" + +#: src/main.c:278 +msgid " k - Move up\n" +msgstr " k - Yukarı git\n" + +#: src/main.c:279 +msgid "" +" l - Move right\n" +"\n" +msgstr "" +" l - SaÄa git\n" +"\n" + +#: src/main.c:280 +msgid "Commands\n" +msgstr "Komutlar\n" + +#: src/main.c:281 +msgid " c - Check solution\n" +msgstr " c - Ãözümü denetle\n" + +#: src/main.c:282 +msgid " H - Give a hint\n" +msgstr " H - İpucu ver\n" + +#: src/main.c:285 +msgid " m - Toggle marks\n" +msgstr " m - İÅaretleri aç/kapat\n" + +#: src/main.c:287 +msgid " N - New puzzle\n" +msgstr " N - Yeni bulmaca\n" + +#: src/main.c:288 +msgid " Q - Quit\n" +msgstr " Q - ÃıkıÅ\n" + +#: src/main.c:289 +msgid " r - Redraw\n" +msgstr " r - Yeniden çiz\n" + +#: src/main.c:290 +msgid " S - Solve puzzle\n" +msgstr " S - Bulmacayı çöz\n" + +#: src/main.c:291 +msgid " x - Delete number\n" +msgstr " x - Sayıyı sil\n" + +#: src/main.c:500 +msgid "Solving puzzle..." +msgstr "Bulmaca çözülüyor..." + +#: src/main.c:506 src/main.c:547 +msgid "Solved" +msgstr "Ãözüldü" + +#: src/main.c:515 +msgid "Generating puzzle..." +msgstr "Bulmaca oluÅturuluyor..." + +#: src/main.c:541 +msgid "Not correct" +msgstr "DoÄru deÄil" + +#: src/main.c:552 +#, c-format +msgid " with the help of %d hints" +msgstr "%d ipucu yardımıyla" + +#: src/main.c:560 +msgid "Correct so far" +msgstr "Åimdiye kadar doÄru" + +#: src/main.c:588 +msgid "Provided hint" +msgstr "İpucu verildi" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nudoku-3.0.0/src/main.c new/nudoku-4.0.0/src/main.c --- old/nudoku-3.0.0/src/main.c 2023-12-21 11:44:39.000000000 +0100 +++ new/nudoku-4.0.0/src/main.c 2024-04-28 16:22:15.000000000 +0200 @@ -3,7 +3,7 @@ nudoku -Copyright (C) 2014 - 2020 Michael "jubalh" Vetter - jubalh _a-t_ iodoru.org +Copyright (C) 2014 - 2024 Michael "jubalh" Vetter - jubalh _a-t_ iodoru.org LICENCE: This program is free software: you can redistribute it and/or modify @@ -56,11 +56,18 @@ #define COLOR_HIGHLIGHT 4 #define COLOR_HIGHLIGHT_CURSOR 5 #define COLOR_USER_HIGHLIGHT 6 +#define UNDO_STACK_SIZE SUDOKU_LENGTH * 10 // arbitrary length. overflows shouldn't cause an error, just a limit in history length. #ifdef DEBUG #define EXAMPLE_STREAM "4.....8.5.3..........7......2.....6.....8.4......1.......6.3.7.5..2.....1.4......" #endif // DEBUG +typedef struct move{ + int x; + int y; + char prev_val; +} move_t; + /* GLOBALS */ static bool g_useColor = true; static bool g_playing = false; @@ -74,6 +81,8 @@ static bool g_outIsPDF; static DIFFICULTY g_level = D_EASY; static WINDOW *grid, *infobox, *status; +static move_t g_undo_stack[UNDO_STACK_SIZE]; /* Stack of previous moves */ +static int g_undo_stack_index = 0; /* FUNCTIONS */ static void print_version(void) @@ -337,12 +346,34 @@ wprintw(infobox, _(" r - Redraw\n")); wprintw(infobox, _(" S - Solve puzzle\n")); wprintw(infobox, _(" x - Delete number\n")); + wprintw(infobox, _(" u - Undo previous action\n")); if (g_useColor) { wattroff(infobox, COLOR_PAIR(1)); } } +static int undo_stack_push(move_t move) { + + if (g_undo_stack_index >= UNDO_STACK_SIZE) { + return -1; + } + g_undo_stack[g_undo_stack_index++] = move; + + return 0; +} + +static int undo_stack_pop(move_t *move) { + + if (g_undo_stack_index <= 0) { + return -1; + } + + *move = g_undo_stack[--g_undo_stack_index]; + + return 0; +} + static int get_character_at_grid(char* board, int x, int y) { int posx, posy; @@ -587,6 +618,7 @@ case 'N': g_useHighlights = false; g_hint_counter = 0; + g_undo_stack_index = 0; werase(status); mvwprintw(status, 0, 0, _("Generating puzzle...")); @@ -651,6 +683,8 @@ // if on empty position if(plain_board[posy*9+posx] == '.') { + // Push coordinates to undo stack + undo_stack_push((move_t){x, y, user_board[posy*9+posx]}); user_board[posy*9+posx] = '.'; wprintw(grid, " "); } @@ -673,6 +707,20 @@ fill_grid(user_board, plain_board, x, y); } break; + case 'u': // Undo + move_t old_move; + if (undo_stack_pop(&old_move)) + { // Stack empty + break; + } + x = old_move.x; + y = old_move.y; + posy = (y-GRID_NUMBER_START_Y)/GRID_COL_DELTA; + posx = (x-GRID_NUMBER_START_X)/GRID_LINE_DELTA; + user_board[posy*9+posx] = old_move.prev_val; + fill_grid(user_board, plain_board, x, y); + break; + default: break; } @@ -684,6 +732,8 @@ // if on empty position if(plain_board[posy*9+posx] == '.') { + // Push coordinates to undo stack + undo_stack_push((move_t){x, y, user_board[posy*9+posx]}); // add inputted number to grid user_board[posy*9+posx] = key; // redraw grid to update highlight diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nudoku-3.0.0/src/outp.c new/nudoku-4.0.0/src/outp.c --- old/nudoku-3.0.0/src/outp.c 2023-12-21 11:44:39.000000000 +0100 +++ new/nudoku-4.0.0/src/outp.c 2024-04-28 16:22:15.000000000 +0200 @@ -3,7 +3,7 @@ nudoku -Copyright (C) 2014 - 2020 Michael "jubalh" Vetter - jubalh _a-t_ iodoru.org +Copyright (C) 2014 - 2024 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-3.0.0/src/sudoku.c new/nudoku-4.0.0/src/sudoku.c --- old/nudoku-3.0.0/src/sudoku.c 2023-12-21 11:44:39.000000000 +0100 +++ new/nudoku-4.0.0/src/sudoku.c 2024-04-28 16:22:15.000000000 +0200 @@ -3,7 +3,7 @@ nudoku -Copyright (C) 2014 - 2020 Michael "jubalh" Vetter - jubalh _a-t_ iodoru.org +Copyright (C) 2014 - 2024 Michael "jubalh" Vetter - jubalh _a-t_ iodoru.org LICENCE: This program is free software: you can redistribute it and/or modify