- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 3
- Posts with Downvotes
- 2
- Downvoting Members
- 3
Hello everyone! I would like to know if there is a way to write false in SWI Prolog instead of error. The situation is the following: I have written a prolog program that says if a statement is a formula or not, for example: ?- fmla(or(a,b)). Answer = true The … | |
public static void removeEvensVer1( List<Integer> lst ) { int i = 0; while( i < lst.size( ) ) if( lst.get( i ) % 2 == 0 ) lst.remove( i ); else i++; } According to my understanding, shouldn't this method be N^3? Since you have a while loop (N) * … | |
The question is pretty straightforward, does BigInteger have a limit? From what I know it is only limited to the amount of memory available on the system, nothing else. This question arose when my instructor told me that one could not calculate 50! using BigIntegers, which I believe one can. … | |
I get this compiler error: `Monster' was not declared in this scope, in this code: [CODE]#ifndef ROOM_H #define ROOM_H #include <stdio.h> #include <stdlib.h> #include <time.h> #include <vector> #include <iostream> #include "Monster.h" using namespace std; const int ROWS = 20; const int COLS = 20; class Room { private: vector<int> indexes; … | |
I am experiencing problems with this function: void move (Room&); For some reason the compiler is saying that this is a variable or field, here is the implementation: [CODE]void Monster::move (Room& room) { vector<int> iCoordinates; vector<int> jCoordinates; for (int i = x - 1 ; i <= x + 1 … | |
I learned that a boolean does not need all the memory space it is provided in order to display true or false (1 or 0), but since the lowest space computers can work with is byte it was expressed as that. I also read that there are ways to store … | |
I made a program using Sockets, pretty interesting, but I have found some "problems" that bother me, my game is threaded and in its run method it has a lot of if statements for the different behaviors when it receives a certain String from the server. Is there any other … | |
I want to learn how to connect computers so I created a game for 2 players that was played on the same computer, now I want it to be played on a network. I have been trying to do this with sockets. I have a server class: [CODE]public class WordsGameServer … | |
I have been trying to make my program load the images while using web start with no success. The following code is inside an extended JButton class. Image is a string containing the address of the desired image ("0.jpg", for example), I know that this would only work if the … | |
Lets say I need to compare the x position of a ball with the x position of a rectangle to see if they have collided. Wouldn't it be easier to just declare x in ball as public so I can use ball.x instead of ball.getX()? | |
Lets say I have a JPanel and an object called ball inside of it, instead of creating gets so the JPanel can draw the ball image I would like the ball object to draw itself on the JPanel. Is it possible? Thanks :D. | |
Is there a way by which I can examine how the class Class was coded? | |
I tried to create an array that would increase its own size depending on the user's action. For example: The user types the name of one contestant, the array contains only one element (the name), later the user enters another contestant, the array becomes an array of 2 elements, each … | |
I have already done most of the program, ask the user for the move, see if it is a valid move, make the move, test if the perimeter is full, etc... but now I see myself troubled with testing if someone has won the game, I could just make a … | |
I was trying to make a function to take the square root of a number (which does not work completely, yet), but while I was coding it, I found an strange "error", this is the code: [CODE] #include <iostream> #include <cstdlib> using namespace std; int main() { double number; cin … |