|
|
Programming › Re: Nairaland Programmers That Share Language And City In Common by Kodejuice: 3:03pm On Oct 27, 2016 |
dhtml18: The poster above me knows EVERYTHING (HE IS A AUTODIDACT POLYMATH) LoL those arent the languages i use, they are top languages based on what nl users claim they use here. i tallied them up |
Programming › Re: Nairaland Programmers That Share Language And City In Common by Kodejuice: 12:39pm On Oct 27, 2016 |
Stats:
Top languages so far: * JavaScript * PHP * Java * Python * C++ * C# * C * VB * ASP * Scala * Swift * Assembly * Cobol * Perl * D * Ada * Machine
Top Frameworks (not all): * NodeJS * Django * AngularJS * Web2py ... |
Programming › Re: How Many Lines Of Code Is Your Largest Work So Far? by Kodejuice: 3:05pm On Oct 10, 2016 |
FincoApps: oh yea, I removed it.... I'll like to mail the source to you No P, kodejuice@gmail.com |
Programming › Re: How Many Lines Of Code Is Your Largest Work So Far? by Kodejuice: 3:57am On Oct 10, 2016 |
FincoApps: This is just the algorithm. The fact and also issue is evaluating if(computer win). This would be a very long method to check if the current winner is the computer. That's wwhere my problem is.
I tried restricting the search to make it detect only horizontal wins and leave out vertical and diagonal and it became a lot faster. But that's not Tic Tac Toe
Kindly look at the codes dhtml15 suggested here https://www.nairaland.com/2529139/tic-tac-toe-online-game to get an idea of the code the link over thereis invalid, 404 |
Programming › Re: How Many Lines Of Code Is Your Largest Work So Far? by Kodejuice: 7:32pm On Oct 09, 2016 |
FincoApps: This is just the algorithm. The fact and also issue is evaluating if(computer win). This would be a very long method to check if the current winner is the computer. That's wwhere my problem is.
I tried restricting the search to make it detect only horizontal wins and leave out vertical and diagonal and it became a lot faster. But that's not Tic Tac Toe
Kindly look at the codes dhtml15 suggested here https://www.nairaland.com/2529139/tic-tac-toe-online-game to get an idea of the code I'll definitely see to it tonight, I'm a little bit busy now. |
Programming › Re: Can You Solve PHP Problems? Let's Find Out.. by Kodejuice: 7:24pm On Oct 09, 2016 |
ANTONINEUTRON: abeg diz might be off topic but i notice a problem in php.
For Example:: $i = 1; while($i<$antoniage){ $i++; echo $i; }
once d loop above run finish, if i want to use $i again in another loop(i intend it to still be equal to 1) it return nothing or False
What might be d problem
Am just a beginner Scope!, you're declaring the variable in an outer scope and incrementing it in the same outer scope, so its changed everywhere, try this <?php $i = 1; $antoniage = 10; //eg function fn1($arg) { $i = $arg; global $antoniage; //make it accessible from this fn while ($i < $antoniage) { $i++; echo $i; } } fn1($i); //$i is still 1 |
Programming › Re: How Many Lines Of Code Is Your Largest Work So Far? by Kodejuice: 4:05am On Oct 09, 2016 |
FincoApps: I'm also using alpha/beta pruning but the game has a 12 X 10 board so it still has A LOT of moves to calculate..... I figured my scoring algorithm needs to be optimized.... still struggling on it though function score(node){ if(computer win) return 100; else if(player win) return -100; else return 0; } since its Tictactoe this would make your game unbeatable, provided you are searching to a reasonable depth. |
Programming › Re: How Many Lines Of Code Is Your Largest Work So Far? by Kodejuice: 5:07pm On Oct 08, 2016 |
FincoApps: LOL dude nor yarb the game, all the moves where hard coded.... I have been trying to implement Minimax algorithm to make it play perfectly but I think this is the hardest algorithm I've dealt with.
I remember begging this seunthomas guy to assist but he completely ignored.... I'm almost there sha  Took me a week to fully grasp that minimax algorithm, but minimax is slow, for speed checkout alpha-beta pruning (a variation of the minimax algorithm but reduces the search tree to return the heuristic score faster) |
Programming › Re: Can You Solve PHP Problems? Let's Find Out.. by Kodejuice: 4:45pm On Oct 08, 2016 |
DanielTheGeek: Including PHP's max() ? of cuz, dat one na cheating na. |
Programming › Re: Can You Solve PHP Problems? Let's Find Out.. by Kodejuice: 4:15pm On Oct 08, 2016 |
make una try this one, saw it in a book i'm reading:
Write a method/function which finds the maximum of two numbers. Don use if-else or any other comparison operator.
EXAMPLE 5, 10 => 5 |
Programming › Re: Can You Solve PHP Problems? Let's Find Out.. by Kodejuice: 4:05pm On Oct 08, 2016 |
FrankLampard: Use any language to solve this very simple.
Question.
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10 001st prime number? Euler? eww |
Programming › Re: Can You Solve PHP Problems? Let's Find Out.. by Kodejuice: 3:59pm On Oct 08, 2016 |
toheebDOTcom: ^^^kodejuice
$foo++ returns the value before incrementing.
++$foo increments before returning the value... That only matters when your echo-ing it, i mean when you do: $foo = "bar"; $foo++; echo $foo;
AND $foo = "bar"; ++$foo; echo $foo;
it outputs d same tin |
Programming › Re: Can You Solve PHP Problems? Let's Find Out.. by Kodejuice: 3:47pm On Oct 08, 2016 |
DanielTheGeek: The explanation is what I'm looking for in this question, so the person with the best explanation towards the behaviour of the code below gets the points.
What will the above code snippet echo out and why exactly? "bas" - i dont think this needs an explanation, the last character in the string was incremented. if the string "123" was incremented, the output would be "124". ($var++ !== $var+1) |
Programming › Re: How Can I Build A Twitter like @mention System In PHP? by Kodejuice: 11:34pm On Oct 07, 2016 |
DanielTheGeek: I hope I got your attention... I'm asking not because I don't know it/I can't implement it but because I want to learn more, so I'm asking all the PHP dare-devils and e-wolves in the house to "help me work this thing out".
Note: Please, I prefer us to do more code than talking, lot's of people will also learn from this thread.
First off: My implementation on CodeIgniter was done using preg_replace (regexp) to strip out the @ and fetch the values after the '@' sign then pass it on to a controller that queries the db through a model for the value after the @ sign in my users table on the db. What I'm saying plainly is that, when you type: @FooBar, I strip off the '@' and search for any user called 'FooBar' in my users_table, If found, return a click able link to the view (front-end). Now, how will you go about implementing yours? Your approach is fine, i can not even tink of any other now. |
Programming › Re: How Can I Build A Twitter like @mention System In PHP? by Kodejuice: 11:28pm On Oct 07, 2016 |
braine: I'm very new to database querying, but why do you need to put the @ with the username when a user wants to search - in the search box(I guess)? The @ is supposes to be for mentioning.. WTF?!, its not a search system its a mention system |
Celebrities › Re: See How This Guy Finished President Buhari’s Daughter On Twitter (lol) by Kodejuice: 6:46pm On Sep 24, 2016 |
LOL |
Programming › Re: Can Anybody Debug This Javascript? by Kodejuice: 3:43am On Sep 21, 2016 |
replace ' var temp = coll[i] ' with ' var temp = coll[i].value', thats the source of the NaN, i haven't ran it yet, i just used my built in debugger.  the error occured when you multiplied an html element with a numerical value, so ur browser dey complain. Error => var temp1 = temp * add_menu_item1 |
|
Programming › Re: Unreal Engine Vs Unity Engine by Kodejuice: 7:39pm On Aug 29, 2016 |
zzzzy: All these game devs, none of you want to make your engine  who told you, they're alot of Nigerian made game engines, some of the devs just dont take it serious, they build it as a fun project and leave it lying on their computer. |
Programming › Re: Unreal Engine Vs Unity Engine by Kodejuice: 9:44pm On Aug 28, 2016 |
When it comes to Next gen graphics i haven't seen any engine that beats the Unreal engine, i've read that the next Unity release will be focusing on that aspect, Unity is very easy to use that's why its more popular and again the Unreal engine was built to make FPS games, but with hacks you can make any kind of game with it.
but for a platformer game, i think Unity will suffice.
Hope this helps 8-) |
Celebrities › Re: Puzzle Time: Can You Solve This Puzzle By Actress Zainab Balogun? by Kodejuice: 12:55pm On Aug 22, 2016 |
Thr answer is 20, just subtract 5 from the row's second element. |
Programming › Re: Php Vs Python Which Is More Easy!! by Kodejuice: 9:21am On Aug 16, 2016 |
python is easy but php is easier  |
|
Programming › Re: Tigerjs My Personal Javascript Library Project by Kodejuice: 11:15am On Aug 04, 2016 |
stack1: why is stuff posting twice??  Because you clicked twice. :> |
Programming › Re: Tigerjs My Personal Javascript Library Project by Kodejuice: 6:15am On Aug 04, 2016 |
Library?, Looks more like a Framework. It contains UI widgets and yet no graphical sample of what we can achieve with this your Library. |
Programming › Re: Please Dont Open by Kodejuice: 4:54am On Aug 04, 2016 |
yunglary: Dhtml if am done do you think anyone would like to use this app when am done? LoL, see Question  |
Programming › Re: Please Dont Open by Kodejuice: 3:47pm On Aug 03, 2016 |
dhtml18: Do that and you might land yourself a lawsuit. This was what I thought when i made an unofficial API for Nigerian stock exchange, in the end, I had to back-down. LoL, so you mean if his app allows users to create new posts and post comments, it's ILLEGAL ? |
|
Programming › Re: Best Way To Detect An Hybrid App ? by Kodejuice: 10:29pm On Jul 13, 2016 |
Depending on the Framework used, you can detect if the one you're familliar with is used. Frameworks like jQuery Mobile(this one is obvious), Ionic, Onsen UI. Framework7 is so hard to detect, since it's near Native in terms of UI, both on Android and IOS. |
Programming › Re: Best Way To Detect An Hybrid App ? by Kodejuice: 10:23pm On Jul 13, 2016 |
Hmmm, These ur methods will only work on Lower-end devices (i.e 512MB Ram), buts it atcually the best way to detect Hybrid Apps. They lag alot on lower-end devices. But its almost impossible to detect hybridness (Just by seeing), if the App is running on a device that has over 2GB Ram |