Commit 5df2af07 authored by Shubham Mishra's avatar Shubham Mishra Committed by Johnny Jazeix

sudoku, added multiple dataset

parent 140f8165
......@@ -36,4 +36,5 @@ ActivityInfo {
credit: ""
section: "discovery logic"
createdInVersion: 0
levels: "1,2,3,4"
}
......@@ -44,6 +44,7 @@ ActivityBase {
signal stop
Component.onCompleted: {
dialogActivityConfig.initialize()
activity.start.connect(start)
activity.stop.connect(stop)
focus = true
......@@ -62,6 +63,7 @@ ActivityBase {
property alias columns: sudoColumn.columns
property alias rows: sudoColumn.rows
property alias sudokuModel: sudokuModel
property var levels: activity.datasetLoader.data
}
onStart: Activity.start(items)
......@@ -72,12 +74,34 @@ ActivityBase {
onClose: home()
}
DialogChooseLevel {
id: dialogActivityConfig
currentActivity: activity.activityInfo
onClose: {
home()
}
onSaveData: {
levelFolder = dialogActivityConfig.chosenLevels
currentActivity.currentLevels = dialogActivityConfig.chosenLevels
ApplicationSettings.setCurrentLevels(currentActivity.name, dialogActivityConfig.chosenLevels)
}
onStartActivity: {
background.stop()
background.start()
}
}
Bar {
id: bar
content: BarEnumContent { value: help | home | level | reload }
content: BarEnumContent { value: help | home | level | reload | activityConfig }
onHelpClicked: {
displayDialog(dialogHelp)
}
onActivityConfigClicked: {
displayDialog(dialogActivityConfig)
}
onPreviousLevelClicked: Activity.previousLevel()
onNextLevelClicked: Activity.nextLevel()
onReloadClicked: Activity.initLevel()
......
......@@ -68,7 +68,7 @@ Item {
anchors.centerIn: parent
sourceSize.height: view.iconSize
source: model.imgName === undefined ? "" :
Activity.url + model.imgName + extension
Activity.url + model.imgName
z: iAmSelected ? 10 : 1
property bool iAmSelected: view.currentIndex == index
......
/* GCompris - Data.qml
*
* Copyright (C) 2020 Shubham Mishra <shivam828787@gmail.com>
*
* Authors:
* Shubham Mishra <shivam828787@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
import GCompris 1.0
Data {
objective: qsTr("Play with smaller grids using symbols.")
difficulty: 3
property var symbols: [
{"imgName": "circle.svg", "text": 'A'},
{"imgName": "rectangle.svg", "text": 'B'},
{"imgName": "rhombus.svg", "text": 'C'},
{"imgName": "star.svg", "text": 'D'},
{"imgName": "triangle.svg", "text": 'E'}
]
data: [
{
"symbols": symbols,
"data": [
[
['.','C','B'],
['.','B','A'],
['.','A','C']
],
[
['C','A','B'],
['.','.','.'],
['B','C','A']
],
[
['C','A','B'],
['A','B','C'],
['.','.','.']
],
[
['A','.','C'],
['C','.','B'],
['B','.','A']
],
[
['A','.','C'],
['B','C','.'],
['.','A','B']
],
[
['A','B','C'],
['B','.','A'],
['.','A','.']
],
[
['.','B','A'],
['B','.','C'],
['A','C','.']
],
[
['A','B','C'],
['.','C','A'],
['.','A','.']
]
]
},
{
"symbols": symbols,
"data": [
[
['A','.','.'],
['D','.','.'],
['C','A','.']
],
[
['C','.','D'],
['.','.','B'],
['.','D','C']
],
[
['.','B','D'],
['D','.','.'],
['B','.','C']
],
[
['A','.','.'],
['.','D','A'],
['D','.','C']
],
[
['C','.','D'],
['.','C','.'],
['B','.','C']
]
]
},
{
"symbols": symbols,
"data": [
[
['.','A','.'],
['A','C','.'],
['.','B','.']
],
[
['B','A','.'],
['A','C','.'],
['.','.','.']
],
[
['.','A','C'],
['.','.','B'],
['C','.','.']
],
[
['.','.','C'],
['D','.','A'],
['C','.','.']
],
[
['.','.','C'],
['D','.','A'],
['.','A','.']
]
]
}
]
}
/* GCompris - Data.qml
*
* Copyright (C) 2020 Shubham Mishra <shivam828787@gmail.com>
*
* Authors:
* Shubham Mishra <shivam828787@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
import GCompris 1.0
Data {
objective: qsTr("Play with medium size grids using symbols.")
difficulty: 4
property var symbols: [
{"imgName": "circle.svg", "text": 'A'},
{"imgName": "rectangle.svg", "text": 'B'},
{"imgName": "rhombus.svg", "text": 'C'},
{"imgName": "star.svg", "text": 'D'},
{"imgName": "triangle.svg", "text": 'E'}
]
data: [
{
"symbols": symbols,
"data": [
[
['.','B','C','D'],
['D','C','.','A'],
['.','D','A','B'],
['B','A','.','C']
],
[
['A','.','.','D'],
['D','C','B','.'],
['C','D','A','.'],
['.','.','D','C']
],
[
['.','B','.','.'],
['.','C','B','A'],
['C','D','A','.'],
['.','.','D','.']
],
[
['.','B','A','.'],
['D','.','B','C'],
['A','C','.','B'],
['.','D','C','.']
],
[
['.','.','.','.'],
['D','A','B','C'],
['A','C','D','B'],
['.','.','.','.']
],
]
},
{
"symbols": symbols,
"data": [
[
['.','.','.','.'],
['D','A','B','.'],
['C','.','A','B'],
['.','.','.','D']
],
[
['A','B','C','D'],
['.','.','.','.'],
['.','.','.','.'],
['B','C','D','A']
],
[
['.','.','A','D'],
['D','.','.','C'],
['A','.','.','B'],
['B','D','.','.']
],
[
['.','.','A','.'],
['D','A','B','.'],
['.','C','D','B'],
['.','D','.','.']
],
[
['C','B','.','D'],
['.','.','.','C'],
['A','.','.','.'],
['B','.','C','A']
],
]
},
{
"symbols": symbols,
"data": [
[
['C','.','.','D'],
['.','.','B','.'],
['A','.','.','.'],
['.','.','D','.']
],
[
['.','B','.','A'],
['.','.','B','.'],
['C','.','D','.'],
['.','.','.','C']
],
[
['A','.','B','.'],
['.','C','.','A'],
['.','.','.','D'],
['D','.','C','.']
],
[
['.','A','.','.'],
['C','.','A','B'],
['.','.','C','.'],
['D','.','.','A']
],
[
['C','.','.','D'],
['B','.','A','.'],
['.','B','.','A'],
['.','.','.','.']
],
[
['.','A','C','.'],
['.','.','.','D'],
['C','.','.','A'],
['.','B','.','.']
],
[
['.','C','.','D'],
['B','.','.','.'],
['.','.','.','.'],
['C','A','.','B']
],
[
['B','.','.','C'],
['.','A','.','.'],
['.','.','D','.'],
['.','B','.','.']
]
]
}
]
}
/* GCompris - Data.qml
*
* Copyright (C) 2020 Shubham Mishra <shivam828787@gmail.com>
*
* Authors:
* Shubham Mishra <shivam828787@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
import GCompris 1.0
Data {
objective: qsTr("Play with medium size grids using numbers and symbols.")
difficulty: 5
property var symbols: [
{"imgName": "circle.svg", "text": 'A'},
{"imgName": "rectangle.svg", "text": 'B'},
{"imgName": "rhombus.svg", "text": 'C'},
{"imgName": "star.svg", "text": 'D'},
{"imgName": "triangle.svg", "text": 'E'},
{"imgName": "1.svg", "text": '1'},
{"imgName": "2.svg", "text": '2'},
{"imgName": "3.svg", "text": '3'},
{"imgName": "4.svg", "text": '4'},
{"imgName": "5.svg", "text": '5'}
]
data: [
{
"symbols": symbols,
"data": [
[
['A','B','C','D','E'],
['.','A','B','C','D'],
['.','.','A','B','C'],
['.','.','.','A','B'],
['.','.','.','.','A']
],
[
['A','B','.','D','.'],
['.','.','D','E','A'],
['C','.','.','A','.'],
['D','E','.','.','C'],
['.','A','B','.','D']
],
[
['.','C','.','A','.'],
['A','.','B','.','C'],
['.','B','.','C','.'],
['D','.','C','.','A'],
['.','A','E','.','B']
],
[
['C','B','.','.','D'],
['.','.','D','C','.'],
['D','.','B','.','E'],
['.','A','.','D','C'],
['E','.','.','B','.']
],
[
['D','.','.','B','E'],
['.','E','A','.','.'],
['A','C','.','.','B'],
['.','.','B','C','.'],
['C','B','.','A','.']
],
[
['.','.','C','D','.'],
['B','.','.','.','C'],
['.','C','.','B','D'],
['C','.','D','A','.'],
['D','E','.','.','A']
]
]
},
{
"symbols": symbols,
"data": [
[
['1','2','3','4','5'],
['.','1','2','3','4'],
['.','.','1','2','3'],
['.','.','.','1','2'],
['.','.','.','.','1']
],
[
['1','2','.','4','.'],
['.','.','4','5','1'],
['3','.','.','1','.'],
['4','5','.','.','3'],
['.','1','2','.','4']
],
[
['.','3','.','1','.'],
['1','.','2','.','3'],
['.','2','.','3','.'],
['4','.','3','.','1'],
['.','1','5','.','2']
],
[
['3','2','.','.','4'],
['.','.','4','3','.'],
['4','.','2','.','5'],
['.','1','.','4','3'],
['5','.','.','2','.']
],
[
['4','.','.','2','5'],
['.','5','1','.','.'],
['1','3','.','.','2'],
['.','.','2','3','.'],
['3','2','.','1','.']
],
[
['.','.','3','4','.'],
['2','.','.','.','3'],
['.','3','.','2','4'],
['3','.','4','1','.'],
['4','5','.','.','1']
]
]
}
]
}
/* GCompris - Data.qml
*
* Copyright (C) 2020 Shubham Mishra <shivam828787@gmail.com>
*
* Authors:
* Shubham Mishra <shivam828787@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
import GCompris 1.0
Data {
objective: qsTr("Play with larger grids using numbers.")
difficulty: 6
property var symbols: [
{"imgName": "1.svg", "text": '1'},
{"imgName": "2.svg", "text": '2'},
{"imgName": "3.svg", "text": '3'},
{"imgName": "4.svg", "text": '4'},
{"imgName": "5.svg", "text": '5'},
{"imgName": "6.svg", "text": '6'},
{"imgName": "7.svg", "text": '7'},
{"imgName": "8.svg", "text": '8'},
{"imgName": "9.svg", "text": '9'}
]
data: [
{
"symbols": symbols,
"data": [
[
['8', '9', '3', '4', '5', '2', '6', '7', '1'],
['7', '1', '6', '3', '9', '8', '5', '.', '2'],
['2', '4', '5', '1', '7', '6', '9', '8', '3'],
['5', '2', '1', '8', '4', '9', '3', '6', '7'],
['9', '6', '.', '2', '3', '7', '1', '5', '8'],
['3', '8', '7', '5', '6', '1', '4', '2', '9'],
['4', '7', '.', '9', '1', '5', '8', '.', '6'],
['6', '5', '9', '7', '8', '3', '2', '1', '4'],
['1', '3', '8', '6', '.', '4', '.', '9', '5']
],
[
['7', '9', '4', '6', '3', '5', '8', '1', '2'],
['8', '3', '2', '4', '9', '1', '5', '7', '6'],
['6', '1', '5', '.', '8', '2', '4', '.', '3'],
['5', '2', '8', '1', '7',