MyNixOS website logo
Description

Sudoku with R.

This is a sudoku game package with a shiny application for playing .

ELKHMISSI - RSDK License


Author


RSDK

RSDK or R SuDoKu is an R package developed for the project of R programming in the master 1 SSD (Statistiques et sciences des donnés),faculty of science Montpellier.
The package contains a shiny application that we can play sudoku on it.

For a full documentation : https://CRAN.R-project.org/package=RSDK


Install RSDK

You can install the package from the CRAN by runing directly in your console:

install.packages("RSDK")

Or use the installation of the package from github, so:

  • First, you need to install the devtools package. You can run in the console the following command
install.packages("devtools")
  • Load the devtools package:
library(devtools)
  • Then use:
install_github("ELKHMISSI/RSDK")

After installation of package, are you ready to play?


launch R SuDoKu

For playing in the shiny application all you need it's to load the RSDK package, and call runSudoku() function, run the following in the console:

library(RSDK)
runSudoku()

How to play in RSDK

After launching the application:

  • Press the start button to start the game

  • Select a level for the game

  • Select an empty cell on the grid by clicking on it once, and put a number from 1 to 9 by the keyboard

  • To remove a value from an edited cell just double clicking on it

  • Check button to verify the grid after playing

  • Solution button gives you the grid competly solved.(don't use it 😈!)

  • If an edited cell turns red that mean that the value on it is on the wrong place (it's already on the row or on the column or on the box), and if it has been turns green it means that the value on it not in the row,column or the box

  • Enjoy!


How difficulties levels are defined in the game ?

What is backtracking algorithm?

https://en.wikipedia.org/wiki/Backtracking

The function bt_solver() in the package use the algorithm of backtracking to solve the incomplete sudoku grid, and it returns a list of two element the first one contains the solved grid, and the second one contains the number of the backtracking, that the function did to solve the grid. So the difficulty of each grid is associated to the number of backtracking that the function bt_solver did on the resolution of the grid. For optimization issues we've we have choose the median of an array of the number of backtracking for 100 incomplete grids of the number of gaps, for example we've choose 45 gaps for the "Easy" level,48 gaps for the "Difficult" level, 51 gaps for the "Hard" level and "54" gaps for the "Legend" level. And the difficulties are as follow:

  • "Easy" level:#Backtracking < 75

  • "Difficult" level: 76 <#Backtracking < 260

  • "Hard" level: 261 <#Backtracking < 600

  • "Legend" level: 600 <#Backtracking


License

Released under MIT by @ELKHMISSI.

Metadata

Version

1.0.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows