Commit a8999a55 authored by Guillaume CLOCHARD's avatar Guillaume CLOCHARD
Browse files

Sauvegarde de la liste de cube

parent e6b7b7b5
......@@ -238,11 +238,28 @@
//le nom du fichier
var file = argv.length > 2 && argv[2] == '-o' ? argv[3] : DEFAULT_FILE;
fs.writeFile(path.join(__dirname, file), content, function (err) {
fs.writeFile(path.join(__dirname, 'rotations-' + file), content, function (err) {
if (err) {
return console.error(err);
}
console.log("Jeu sample sauvé dans", file);
console.log("Jeu sample de rotations sauvé dans", 'rotations-' + file);
});
//il peut être utile de n'avoir qu'une bête liste de cube
var cubes = { cubes : [] };
Object.keys(result).forEach(function (origin) {
cubes.cubes.push(origin);
Object.keys(result[origin]).forEach(function (m) {
cubes.cubes.push(result[origin][m]);
});
});
content = JSON.stringify(cubes);
fs.writeFile(path.join(__dirname, 'liste-' + file), content, function (err) {
if (err) {
return console.error(err);
}
console.log("Liste sauvée dans", 'liste-' + file);
});
});
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment