From b8111af5c8bad56273239e6b33100e6ff6a9492b Mon Sep 17 00:00:00 2001 From: ParveenB Date: Wed, 24 Jun 2015 11:17:04 +0530 Subject: [PATCH 1/6] Create script.js --- projects/AddGame/script.js | 63 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 projects/AddGame/script.js diff --git a/projects/AddGame/script.js b/projects/AddGame/script.js new file mode 100644 index 00000000..1cb68cc5 --- /dev/null +++ b/projects/AddGame/script.js @@ -0,0 +1,63 @@ +var addapp=angular.module('addapp',[]); + addapp.controller('addctrl', ['$scope','$rootScope', function($scope,$rootScope){ + + $scope.add=[]; + $scope.count=0; + $scope.a=function(num1) + { + $scope.number=num1; + $scope.showDetails=true; + } + $scope.getRandomSpan = function(){ + return Math.floor((Math.random()*6)+1); + } + $scope.ans=function(num1,num2) + { + $rootScope.check=parseInt(num2)+parseInt(num1); + if($rootScope.check==$scope.result) + { + $scope.count=$scope.count+1; + $scope.add.push($scope.result); + $scope.so=$scope.result; + $scope.comment=true; + + /*$scope.num2=Math.floor((Math.random()*15)+125);*/ + $scope.num2=(($scope.result*3)-13%3); + $scope.f=$scope.count; + delete $scope.result; + } + + else + { + $scope.message="SORRY!!! YOU LOSE"; + $scope.hideit=true; + $scope.playagain=true; + delete $scope.result; + } + } + + + }]); + + + +addapp.directive('numbersOnly', function(){ + return { + require: 'ngModel', + link: function(scope, element, attrs, modelCtrl) { + modelCtrl.$parsers.push(function (inputValue) { + // this next if is necessary for when using ng-required on your input. + // In such cases, when a letter is typed first, this parser will be called + // again, and the 2nd time, the value will be undefined + if (inputValue == undefined) return '' + var transformedInput = inputValue.replace(/[^0-9]/g, ''); + if (transformedInput!=inputValue) { + modelCtrl.$setViewValue(transformedInput); + modelCtrl.$render(); + } + + return transformedInput; + }); + } + }; +}); From 661ccaeca5caed487e602e8cb01f4f1febc98621 Mon Sep 17 00:00:00 2001 From: ParveenB Date: Wed, 24 Jun 2015 11:17:40 +0530 Subject: [PATCH 2/6] Create index.html --- projects/AddGame/index.html | 145 ++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 projects/AddGame/index.html diff --git a/projects/AddGame/index.html b/projects/AddGame/index.html new file mode 100644 index 00000000..46ab5f7e --- /dev/null +++ b/projects/AddGame/index.html @@ -0,0 +1,145 @@ + + + + Add as much as u can + + + + + + +
+ +
+
+
+ +

ADD AS MUCH YOU CAN

+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+ + +
+
+

Your number

+ +
+ +
+

Random Number

+ +
+ +
+

Your Answer

+ +
+ +

Score {{f}}

+ + +
+
+

nice !! Your Last Answer is {{so}}

+
+ +
+
+ + + + + + + + + + + From ec79ac810093504ec8c43967e0316333f8979dcd Mon Sep 17 00:00:00 2001 From: ParveenB Date: Wed, 24 Jun 2015 11:19:11 +0530 Subject: [PATCH 3/6] Create h.html --- projects/AddGame/h.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 projects/AddGame/h.html diff --git a/projects/AddGame/h.html b/projects/AddGame/h.html new file mode 100644 index 00000000..16f948b5 --- /dev/null +++ b/projects/AddGame/h.html @@ -0,0 +1,15 @@ + + + + + + +JS Bin + + + + + + + + From da57248b05bb01019ab50225ef9e0e1a302c09d4 Mon Sep 17 00:00:00 2001 From: ParveenB Date: Wed, 24 Jun 2015 11:19:35 +0530 Subject: [PATCH 4/6] Create try.html --- projects/AddGame/try.html | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 projects/AddGame/try.html diff --git a/projects/AddGame/try.html b/projects/AddGame/try.html new file mode 100644 index 00000000..8793fd78 --- /dev/null +++ b/projects/AddGame/try.html @@ -0,0 +1,41 @@ + + + add as much as u can + + + + + + + +
+ +
+ + + + + From 02b6f75064eead06dbc82f7ef4be3a1be67075ae Mon Sep 17 00:00:00 2001 From: ParveenB Date: Wed, 24 Jun 2015 11:22:03 +0530 Subject: [PATCH 5/6] Create thumb.png --- projects/AddGame/thumb.png | 1 + 1 file changed, 1 insertion(+) create mode 100644 projects/AddGame/thumb.png diff --git a/projects/AddGame/thumb.png b/projects/AddGame/thumb.png new file mode 100644 index 00000000..5ba64c89 --- /dev/null +++ b/projects/AddGame/thumb.png @@ -0,0 +1 @@ +https://cdn4.iconfinder.com/data/icons/meBaze-Freebies/512/add.png From 41d65b9d0ed498c29d7721fb2283331ac85c74f9 Mon Sep 17 00:00:00 2001 From: ParveenB Date: Wed, 24 Jun 2015 11:33:33 +0530 Subject: [PATCH 6/6] Update projects.json --- projects/projects.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/projects/projects.json b/projects/projects.json index f92b527e..80c52d2c 100644 --- a/projects/projects.json +++ b/projects/projects.json @@ -2,6 +2,17 @@ "featured": "YouTube on PS3", "projects": [ { + "name": "Add Game", + "thumb": "AddGame/thumb.png", + "desc": "Add as much as you can", + "submitter": "ParveenB", + "submissionDate": "2015-06-24", + "tags": [ + "Demo", + "Game", + "No jQuery" + ] +}, { "name": "APWGL", "thumb": "apwgl/thumb.png", "desc": "Fan made ARTPOP WebGL App. Renders WebGL to Gif.",