Search Results

Search found 3 results on 1 pages for 'samuraisoulification'.

Page 1/1 | 1 

  • How can I ensure reasonably spaced out enemies

    - by Samuraisoulification
    I have a simple javascript game and I'm initializing their positions on the y axis using random numbers. How can I ensure that they are reasonably spaced apart? My simple algorithm is: y = (Math.random()*1000%600); However I frequently get enemies almost directly on top of each other. This is a huge problem for the game, since it's a word game and the enemies have text on their center, that if overlapped makes them impossible to kill since you can't see the words. Any advice would be appreciated! I'm pretty new to making games in general so this has all been a learning experience for me!

    Read the article

  • WAMP phpmyadmin gives a blank page no matter what I do

    - by Samuraisoulification
    I've been trying to get phpmyadmin to work on Win 7 64bit (newest download on the site) and I can get it working, the php part works fine, the problem is I can't get into phpmyadmin. It just gives a blank page, even I click view source it's completely blank. I've been scouring the internet for 2 or 3 days now, but no luck. Also, the php and mysql error logs don't have any errors. I need to get this up to work on a project for school, so any help would be appreciated! If you need any more info just ask!

    Read the article

  • UVA Online Judge 3n+1 : Right answer is Wrong answer

    - by Samuraisoulification
    Ive been toying with this problem for more than a week now, I have optimized it a lot, I seem to be getting the right answer, since it's the same as when I compare it to other's answers that got accepted, but I keep getting wrong answer. Im not sure what's going on! Anyone have any advice? I think it's a problem with the input or the output, cause Im not exactly sure how this judge thing works. So if anyone could pinpoint the problem, and also give me any advice on my code, Id be very appreciative!!! #include <iostream> #include <cstdlib> #include <stdio.h> #include <vector> using namespace std; class Node{ // node for each number that has teh cycles and number private: int number; int cycles; bool cycleset; // so it knows whether to re-set the cycle public: Node(int num){ number = num; cycles = 0; cycleset = false; } int getnumber(){ return number; } int getcycles(){ return cycles; } void setnumber(int num){ number = num; } void setcycles(int num){ cycles = num; cycleset = true; } bool cycled(){ return cycleset; } }; class Cycler{ private: vector<Node> cycleArray; int biggest; int cycleReal(unsigned int number){ // actually cycles through the number int cycles = 1; if (number != 1) { if (number < 1000000) { // makes sure it's in vector bounds if (!cycleArray[number].cycled()) { // sees if it's been cycled if (number % 2 == 0) { cycles += this->cycleReal((number / 2)); } else { cycles += this->cycleReal((3 * number) + 1); } } else { // if cycled get the number of cycles and don't re-calculate, ends recursion cycles = cycleArray[number].getcycles(); } } else { // continues recursing if it's too big for the vector if (number % 2 == 0) { cycles += this->cycleReal((number / 2)); } else { cycles += this->cycleReal((3 * number) + 1); } } } if(number < 1000000){ // sets cycles table for the number in the vector if (!cycleArray[number].cycled()) { cycleArray[number].setcycles(cycles); } } return cycles; } public: Cycler(){ biggest = 0; for(int i = 0; i < 1000000; i++){ // initialize the vector, set the numbers Node temp(i); cycleArray.push_back(temp); } } int cycle(int start, int end){ // cycles thorugh the inputted numbers. int size = 0; for(int i = start; i < end ; i++){ size = this->cycleReal(i); if(size > biggest){ biggest = size; } } int temp = biggest; biggest = 0; return temp; } int getBiggest(){ return biggest; } }; int main() { Cycler testCycler; int i, j; while(cin>>i>>j){ //read in untill \n int biggest = 0; if(i > j){ biggest = testCycler.cycle(j, i); }else{ biggest = testCycler.cycle(i, j); } cout << i << " " << j << " " << biggest << endl; } return 0; }

    Read the article

1