From e56738631b86d3295e68c278114775673740f3c1 Mon Sep 17 00:00:00 2001 From: agungcaproex Date: Fri, 23 Feb 2018 10:27:31 +0700 Subject: [PATCH 1/3] first 10.27 --- async/index.js | 5 +++ oop/robot.js | 103 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 oop/robot.js diff --git a/async/index.js b/async/index.js index 77df3b7..54ce8d1 100644 --- a/async/index.js +++ b/async/index.js @@ -17,6 +17,11 @@ class RNG { return result; } + + static gatchaRoll(times, callback){ + + } + } function viewGachaResult(best) { diff --git a/oop/robot.js b/oop/robot.js new file mode 100644 index 0000000..14988b3 --- /dev/null +++ b/oop/robot.js @@ -0,0 +1,103 @@ +class Robot{ + constructor(name, purpose){ + this._name = name + this._purpose = purpose + } +} + +class RobotFactory{ + constructor(){ + this.robotName = [] + + } + + static produceRobot(name, count){ + var arrRobot = [] + if(name == 'wall-e'){ + for(let i=0; i Date: Fri, 23 Feb 2018 11:02:48 +0700 Subject: [PATCH 2/3] the end --- async/index.js | 20 ++++++++++++++++++-- query/database.db | Bin 20480 -> 28672 bytes 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/async/index.js b/async/index.js index 54ce8d1..8fdd862 100644 --- a/async/index.js +++ b/async/index.js @@ -19,7 +19,23 @@ class RNG { } static gatchaRoll(times, callback){ + if(times == 0){ + console.log('0') + } + else{ + console.log(RNG.roll()) + } + } + static gatchaRollPromise(times){ + return new Promise(function(resolve, reject){ + if(times == 0){ + reject(result) + } + else{ + resolve(result) + } + }) } } @@ -40,13 +56,13 @@ RNG.gatchaRoll(0, function(result) { viewGachaResult(result) }); // output: 0 // RELEASE 1 TEST CASES RNG.gatchaRollPromise(5) .then(function(result) { viewGachaResult(result) }) - .catch(function(err) { viewGachaFailure() }; + .catch(function(err) { viewGachaFailure() }); // akan menampilkan di log: YOUR BEST GATCHA ROLL RESULT IS RNG.gatchaRollPromise(0) .then(function(result) { viewGachaResult(result) }) - .catch(function(err) { viewGachaFailure() }; + .catch(function(err) { viewGachaFailure() }); // akan menampilkan di log: YAKIN NGGAK MAU NGE-ROLL? diff --git a/query/database.db b/query/database.db index 77b32335557d0d8348af0a5f80acb8ba9da025e9..af5ea7d3116952a455ee0aadadb18556546ff77d 100644 GIT binary patch delta 3019 zcmeH|?QdJv9mnrE=RWx1o^xV1cAgvCu@fh8TIT^snw1R~L5*tqi@$?3fQVK$B0|A<-3Yvz>gXp?uFD96#O&}^H6a<`eVnmJo z2kgb(Tv^Az-+f}Jpqm`g5OpdRMRwTKGX;3$vsce?Q#2(M*mAM&@=QDJwcDt zS?bUmXb)|smDD7klMCbwd6_&(?j=Xa7}-hIlNM4*O#CIjh|l6z@YDDKd=%e`cjEOp ziL0^8zI2j3V$b>GhE`Dl2FKH>$?<+?GBx4&{SAgz69Csb>5=itOnOkPRr%}H+}6x! zX2w~b3;JS)Ruur-QsdL9$&?%`_ea&(fHRv(=f*00b!x1C{E(APtFhYBh@pi8U@$c| zJu|siY*sf3_`_=VMzOFrx7$xchE^5;15P$|SlyzeRtyC|e`+=}p??@&{u zL$#W_yu)13S5;V|QqAR;s3^gR9alrQuq?e#!Z z2G^&uBU9RC9~V3bRe){Nsp*-ixEG)*uw^1O>tv_IzfscwT@qK#qD!14x8Cd;bFFi& zuokVCta)qHy3VRHKQ&)9A2bh`>&$B7E8`vG0pk`UVOaX#^%wPH`mo-FzD4KJNpv4_ zP#e+XQ<+xez79bg-0Yg)io{=%9VxPgBlu3Pv*PXeL3A%3wZf>2~L zA6i=n26?-jys4M-0S@Nd_K!OwW8s}XFxzb}N`O&j=RS2O76Lw!kv z64&u}yIR1tB2g5fru97B-3+ebgWYkkPDF|zn7mqqY6X2F(iNbWqn>uqBN8`? zeG$+q5;Y>DH7PQ+fz={WGeWUd>XcgKDV^e-W7e>EMCL9mu5o)&qhHXA^ejD1AEU?U zVLC!L(N5Y(%P1oMAs>>r$O3tU+(izM6d592Bt{5c!k^)D_z(Cw{5$+>JcWmGKW@h% zY}=R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file changed, 1 insertion(+) create mode 100644 query/note-SQL.txt diff --git a/query/note-SQL.txt b/query/note-SQL.txt new file mode 100644 index 0000000..1db515f --- /dev/null +++ b/query/note-SQL.txt @@ -0,0 +1 @@ +S \ No newline at end of file