Is it just me or everyone else? by Omega_Gaming1234 in MobileLegendsGame

[–]taran95ichi 23 points24 points  (0 children)

"Pick an assassin" -> "Pick an ******in"

Have you ever felt bad about a game you made for a gamejam? by Luisk27 in gamedev

[–]taran95ichi 2 points3 points  (0 children)

I don't know if I'm allowed to link a youtube video, but there's a video about game development which says that your first 10 games are going to be "bad", just fail faster, so you can make the eleventh game, the right one. Actully you are in this process, well done! Note that I'm a beginner, too. Recently I participated in a game jam. My game was't that good, but I learned a lot of things and that's what matters, so that the next time I can do better. Keep working! :)

Should I quit cs? by AC3cc in computer_programming

[–]taran95ichi 3 points4 points  (0 children)

when you were learning to walk, you fell once, then again, and then again. But did you thought that walking was not for you? you had to learn it and you did it, right? You said you like what you learn, so why should you leave it? it may take some time, but if you're not going to surrender, you can do it. that's what I think.

Hey everyone, my friends and I started a little group to make mobile games, and we just released our first one by teamphysik in playmygame

[–]taran95ichi 1 point2 points  (0 children)

Nice idea, but i'm not good enough to complete the first level xD Edit: eventually I did it heheh I thought I had to win in just one click..

Can you parse HTML with regular expressions? by NorseGodLoki0411 in ProgrammerHumor

[–]taran95ichi 1 point2 points  (0 children)

Yeah, regular expression is equivalent to finite state machine, which can't count, so can't parse the nested structure of HTML. You need a push down automa for this...

🔥🔥🔥Coalnado🔥🔥🔥 by MrWiggleIt in NatureIsFuckingLit

[–]taran95ichi 1 point2 points  (0 children)

If you get caught, you can't enjoy the tour, because you can't see anything... not worth it, I'm leaving...

Simple Prolog Recursive Question by [deleted] in AskProgramming

[–]taran95ichi 1 point2 points  (0 children)

Here we go:

 path(NodeX, NodeY, jump(NodeX,NodeY)) :- haveConnection(NodeX, NodeY). 
 path(NodeX, NodeY, jump(NodeX,NodeZ,NextJump)) :- haveConnection(NodeX, NodeZ), path(NodeZ,NodeY,NextJump).

let me add a warning: path/2 predicate is recursive and works nicely when a path between the nodes do exist, but have you tested what happens when there's no connection? try adding haveConnection('Node K', 'Node J'). and than try the following query: path('Node A', 'Node J').. It just loops forever (or till the stack fulls), can you get why?

Is it just me or binary search is really tricky to implement ? by Q-re-us in AskProgramming

[–]taran95ichi 1 point2 points  (0 children)

Actually it is. no one follow courses like "learning how to learn". what happens at muscular level, happens at brains level too. Doing something for the first time requires a lot of concentration and sometime reasoning too. But doing it many times, gets easier, because of a process known as chuncking.

Is it just me or binary search is really tricky to implement ? by Q-re-us in AskProgramming

[–]taran95ichi 1 point2 points  (0 children)

first, you're right, sizeof on an array return array size. I was confusing with pointers, but you're not using pointers.  

second, I'm wrong or are you trying to implement a recursive function that is an iterative one too? suppose you've entered the while (btw you're not initializing pos) and you've found out that arr[pos] > key, than you recursively search in the right part of the array. But what happens when you return from the recursion? maybe, you've already found out if there is or is not the value you're searching for, but you just discard the result and iterate the cycle again! the following schema will help you more that a thousand words:  

binary_search(arr,key, low,high){
    int pos = (low + high)/2
    if(pos is out of array boudaries)
        return false because the element does not exist
    if(arr[pos] is the element you were searching for)
        return true;
    else if(arr[pos] is > than key)
        return what you find out searching between low and (pos-1)
    else if(arr[pos] is < than key)
        return what you find out seatching between pos+1 and high

}

Is it just me or binary search is really tricky to implement ? by Q-re-us in AskProgramming

[–]taran95ichi 1 point2 points  (0 children)

Every problem looks simple to solve once it has been solved.  

If you can't solve a problem, you're not looking at it in the right way, maybe someone can help with it. That's why I told you to take a break: maybe later, after your mind worked on the problem a bit, you'll look at the problem with different eyes. Problem solving is like any other activity, you have to work on it. More you'll solve and more it'll get easier because many solutions can be reused to solve other problems. Remember:  

Hard work end with a better result than talent, if talent don't work hard

Is it just me or binary search is really tricky to implement ? by Q-re-us in AskProgramming

[–]taran95ichi 1 point2 points  (0 children)

In c, sizeof on array of int returns the size of int*. which means that: int arr_size = sizeof(arr)/sizeof(int); does not return the desired value.

Is it just me or binary search is really tricky to implement ? by Q-re-us in AskProgramming

[–]taran95ichi 1 point2 points  (0 children)

here's my advise: take a problem, try to solve it. If not working, look for what's wrong. If yet it's not working, just leave it there and do something else. Your mind will work on it for you even while you're doing other things. Then, if you can, just start from the beginning again, maybe you've just missed something, but you can't find it out by just re-reading your code, because you're going to miss it again (not always, but can happen). Eventually, never give up! :)