+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/data/zadanieDnia/test.txt b/app/data/zadanieDnia/test.txt
index 47c17e3..0bcff2e 100644
--- a/app/data/zadanieDnia/test.txt
+++ b/app/data/zadanieDnia/test.txt
@@ -1,7 +1,7 @@
-You Don't Know JS: ES6 & Beyond
-Foreword
+yOu dOn't kNoW Js: Es6 & BeYoNd
+fOrEwOrD
-Kyle Simpson is a thorough pragmatist.
+kYlE SiMpSoN Is a tHoRoUgH PrAgMaTiSt.
-I can't think of higher praise than this. To me, these are two of the most important qualities that a software developer must have. That's right: must, not should. Kyle's keen ability to tease apart layers of the JavaScript programming language and present them in understandable and meaningful portions is second to none.
-[https://github.com/getify/You-Dont-Know-JS/blob/master/es6%20%26%20beyond/foreword.md]
\ No newline at end of file
+i cAn't tHiNk oF HiGhEr pRaIsE ThAn tHiS. tO Me, ThEsE ArE TwO Of tHe mOsT ImPoRtAnT QuAlItIeS ThAt a sOfTwArE DeVeLoPeR MuSt hAvE. tHaT'S RiGhT: mUsT, nOt sHoUlD. kYlE'S KeEn aBiLiTy tO TeAsE ApArT LaYeRs oF ThE JaVaScRiPt pRoGrAmMiNg lAnGuAgE AnD PrEsEnT ThEm iN UnDeRsTaNdAbLe aNd mEaNiNgFuL PoRtIoNs iS SeCoNd tO NoNe.
+[hTtPs://gItHuB.CoM/GeTiFy/yOu-dOnT-KnOw-jS/BlOb/mAsTeR/Es6%20%26%20BeYoNd/fOrEwOrD.Md]
\ No newline at end of file
diff --git a/app/zadanie01.js b/app/zadanie01.js
index 8c20173..f5e84d1 100644
--- a/app/zadanie01.js
+++ b/app/zadanie01.js
@@ -1 +1,13 @@
-//Twój kod
\ No newline at end of file
+//Twój kod
+const fs = require('fs');
+
+fs.readFile('./data/zadanie01/input.json', 'utf8', (err, data) => {
+ if (err === null){
+ console.log('Poprawnie odczytano tablicę:', data);
+ const arr = JSON.parse(data);
+ let sum = arr.reduce(function (a, b) {return a + b;}, 0);
+ console.log(`Suma elementów w talicy to: ` + sum);
+ } else {
+ console.log(`Błąd...`, err)
+ }
+});
\ No newline at end of file
diff --git a/app/zadanie02.js b/app/zadanie02.js
index 8c20173..0a1459a 100644
--- a/app/zadanie02.js
+++ b/app/zadanie02.js
@@ -1 +1,13 @@
-//Twój kod
\ No newline at end of file
+//Twój kod
+const fs = require('fs');
+
+fs.readdir('./data/zadanie02/', (err, files)=>{
+ if (err === null){
+ console.log('Lista plików:');
+ files.forEach(file => {
+ console.log(file);
+ });
+ } else {
+ console.log(`Błąd...`, err)
+ }
+})
\ No newline at end of file
diff --git a/app/zadanieDnia.js b/app/zadanieDnia.js
index 8c20173..47776d9 100644
--- a/app/zadanieDnia.js
+++ b/app/zadanieDnia.js
@@ -1 +1,22 @@
-//Twój kod
\ No newline at end of file
+//Twój kod
+const fs = require('fs');
+
+fs.readFile('./data/zadanieDnia/test.txt', 'utf8', (err, data) => {
+ if (err === null){
+ let text = data;
+ let res = text.split('').map(function(v,i){
+ return i%2 === 0 ? v.toLowerCase():v.toUpperCase()
+ });
+ console.log(res.join(''));
+ fs.writeFile('./data/zadanieDnia/test.txt', res.join(''), err => {
+ if (err === null){
+ console.log('Zapisano poprawnie!');
+ } else {
+ console.log('Błąd podczas zapisu pliku!', err);
+ }
+ });
+
+ } else {
+ console.log(`Błąd...`, err)
+ }
+});
\ No newline at end of file