- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 7
- Posts with Upvotes
- 6
- Upvoting Members
- 7
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
76 Posted Topics
Re: Heres a good one that I made.. The countdown game as shown on tv in england... There are 6 numbers, say 1,2,5,10,25,100 and a target say 603 My program generates the target in the smallest number of calcuations Using only +,-,x,divide. Or the number closest possible to target. Its basically … | |
Re: I'm not quite sure what you're trying to do, I've made a snake game myself... [URL="http://www.colin-java.co.uk/progs/SNAKE/SG/SG.jar"]here[/URL] You probably want a 2D array, then something like a LinkedList<Point>. Each point can represent a (y,x) position in the array, with say the first entry being the head, and the last is the … | |
Re: Hi But this looks totally wrong, consider 220 and 284 220: 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110,[sum of 284] 284: 1, 2, 4, 71, 142 [sum of 220] So the code should be.. [CODE] class Amicable { public static void main(String[] args) { int num1 … | |
Hi I've made a cube in Javafx 2.0, see [URL="http://www.colin-java.co.uk/pics/ftcfx.png"]http://www.colin-java.co.uk/pics/ftcfx.png[/URL] But as everyone can see, the edges of the shapes / image are horrendous. This is even with smooth set to true, but it appears to do nothing. Setting it to false seems to make no difference. I've tried googling … | |
Hi, I've just completed my chess program in java. Its at [URL]http://www.colin-java.co.uk/JChess/index.htm[/URL] I'm looking for a new project now, something to take my time up. Any good ideas. :?: | |
Re: open your command prompt. Change your directory to wherever your programs are... Eg if they are in C:\java, then: cd c:\java ENTER Then javac fileName.java ENTER That line compiles it, and creates a .class file, Next... to execute the program... java fileName.java ENTER If you used an IDE like netbeans … | |
Hi, I've just uploaded a very simple web app that uses hibernate via a war file to my webserver: [URL="http://www.colin-java.co.uk/BANK"]http://www.colin-java.co.uk/BANK[/URL] The first couple of times I loaded the page above, it was fine, and it correctly displayed some of the contents of the User (MySQL) table. But now when I … | |
Re: You should expand a little on this, it seems like its coursework assignment. But anyway F = -kx, where F and x are vectors. Question seems a little out of context to me... You simulate hookes law using physical experiments with different materials. I don't see how a computer can … | |
Hi, I'm using Netbeans 6.9, Glassfish v2, and Hibernate 3.2.5 (I think). I Basically have a very simple web-app that reads from a database. I can run the web-app in Netbeans locally under glassfish v2 without any problems. Now I'm trying to get the web-app to work on actual web-server … | |
Re: Yes I think he means.. Integer.toString(int i).. Or just write ""+i, this will create a String of the number, thats what I would do. | |
Hi, I have a project that uses 'basicplayer', a mp3 player. I can get it to work when it runs in netbeans 6.9.1, but when I build project (into jar file in dist folder), it no longer runs. I need to get the jar files that I added to project … | |
Hi, I have 2 applet problems. 1) I uploaded a new jar file to server to replace old one. When I load web page in browser for that applet (on this pc), I keep getting the old jar file getting loaded as the applet (even on different browsers on this … | |
Hi, I'm trying to draw 2 quadrilatrials, that share 2 corners and an egde. I also want to smooth edges, so I use ANTIALIASING turned on, but this has the effect of showing a crack between the polygons. The crack dissapears if I turn off ANTIALISAING, but I really don't … | |
Re: OK, I've fixed it. Firstly... Where you have library as your class, you seem to have libary else where in the code, you need to change it all to library. Secondly... in the library.displaylibrary() method, you're using yearpublish, not yearpublished. Thirdly... When you call insert method, it needs to take... … | |
Re: I don't get it, its pretty pointless, but does show how to draw things. I'm building a 3D chessboard which should be useful, but its too big to fit as a code snippet. | |
Hi, I'd like to be able to put a JTable inside a ScrollPane, so that when the table is large, the horizontal and/or vertical scrollbars 'kick in', and when the JTable is small, I just get a small JTable. Also I want to limit the size of the scrollpane to … | |
Hi, I'm building an application and I want to it to play mp3 files. I have it working, basically by installing JMF2.1.1e, and then I add its jmf.jar file to the build path of the project within eclipse. When I then jar up the project, and place on desktop, it … | |
Re: Hi, I assume this is a console based application. Try using Scanner scanner = new Scanner(System.in); Then String line = scanner.readLine() will read in the line entered. Then perhaps Collections.sort(list) will sort a list of objects for you. Thats probably the easiest thing to do. | |
Re: In my personal opinion, I would say there is no quick way of doing this, since the image is made from solid colours, appling a transparent rectangle behind or above will not make it see through. I think I would have coded it differently, perhaps get the pixel data for … | |
Re: You need to cast at least one of: Correct Questions into a double before it will work. You basically have int x = 3/4; // for example, since its an int/int So x is 0. Then this is cast to a double, to get 0.0. But doing 3.0 / 4 … | |
Re: [QUOTE=AngryOne;1055596]Hello I'm begining to learn Java and I'm trying to convert from a While loop into a for loop. Sadly I'm just not quite grasping it... I understand the loop is here [CODE]while (n * n > Math.pow(2,i)) { i++; } [/CODE] but it's not quite as simple as changing … | |
Hi, I'm looking for some J2EE ideas, I have JSP hosting (1G hdd), and also access to MySql database, as well as perl/php, etc. I currently have a chess app, allowing users to play chess in 3D against each other or the computer that takes advantage of a few servlets … | |
Re: Interesting, but not very fun. But nicely constructed, and a good tool for beginners to look at to get a flavour of guis. | |
This program generates the 6 faces of a colour cube. The faces are displayed in a JPanel, and they are also saved to C:/Faces as PNG files. So non-windows users might have to alter code slightly. | |
Re: Nice program, but not very fun. If you could make some mad coloured images that would be more fun. Still good though, does what it says on the tin! | |
Re: Hi, looking at your code, I can see only 0 as answer When you do 5/9, your dealing with ints, so thats 0. I think you should do 5.0/9 or 5/9.0 or (double)5/9 or 5/(double)9, or or just 0.55555555555555555 | |
Hi, I'm hoping someone can help me with this problem. Over last couple of days, when I start up computer, it gets to the windows screen, and the blue bar thing just goes round and round, and it never gets into windows. I eventually get it to start up, if … | |
Re: A couple of ideas.. A chess game (Will take a long time, I've done one) A checkers game, similar to chess, but easier Connect 4 Build a 3D rubiks cube Or build a program where you can view 3D shapes,requires use of vectors and some tricky math. | |
Hi, I have an application, that has a JFrame. Added to the JFrame's contentPane is a JDesktopPane. I use JMenuItems in the JMenu (in JMenuBar) to add, and then remove a JInternalFrame inside the JDesktopPane. But now.. when I use any acclerator keys, to invoke JMenuItems, they don't work, its … | |
Re: Hi, I'm new to C# ASP.NET too. I don't understand what Visual Studio is. Is Visual Studio actually an IDE that you can use to do things, or... Is it a collection of 6 technologies... 1. Visual C# Express 2. VWD 3. Visual J# 4. Visual C++ 5. Visual Basic … | |
Re: Seems like a simply program, why would it take so long? Theres only 8!=40,320 positions to look at then test. If you put a queen in each column, then first queen has 8 options, next has 7, and so on, so filling up a position this way means you just … | |
Re: Hi I'm writing a chess program, [URL="http://www.colin-java.co.uk/JChess2"]http://www.colin-java.co.uk/JChess2[/URL] So I might be able to help a little, you would obviously need alpha-beta pruning. I guess you would use iterative deepening with that. I'm not sure if Quiescent Search applies because every move is a capture, so position will never go quiet. … | |
Re: Its simple, I don't see the point for all that code, and I'm not sure why your class is called LinkedList, theres already a LinkedList in the java.util package. I've just written the code below, might be a couple of bugs in it, I haven't tested it, but thats how … | |
Re: You can do either, but initialising a 3D array in one go can be a little daunting, depending on what your putting in. You could just initialise all your double arrays, then do... String[][][] array=new String[][][]{ doubleArray1,doubleArray2,doubleArray3, etc,...} Hope that helps | |
Hi, I'm looking to update a MySql database from an applet. The 2 roots I was thinking were: Applet->php->database Applet->servlet->database But my webhost doesn't allow servlets/jsp, so I would like to try the php route. I've looked on the internet, but I can't find anything concrete to use, just lots … | |
Re: I haven't read the code, but perhaps something like this... You have an array of length 6 eg dice[]. Each time you get a 1, you do dice[0]++; Each time you get a 2, you do dice[1]++; In general, you do dice[num-1]++; saves you having 6 variables for each different … | |
Hello there, I come from a Java background, and I am a very able with java. I would like to try C++ to build a chess engine, since my java chess engine lacks the performance that can be obtained using C++. I've been trying to set up a C++ IDE, … | |
Re: I doubt its impossible, the information is on the OS, I think its possible, if it wasnt, why have an assignment on it. | |
Re: Hmmm, I don't get it In your Book2 class, you've got: [B][COLOR=#7f0055]super[/B][/COLOR][COLOR=#000000](bookTitle, itemNumber, bookUnits, bookPrice);[/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000]but when I look at java.awt.print.Book,[/COLOR] [COLOR=#000000]the only constructor I see is Book().[/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000]I've never even seen this class before, but still, if the constructor you are invoking doesn't exist, thats a problem.[/COLOR] … | |
Re: Question is a little vague, but I think you mean: int x=5; String y=""+x; So y is "5" To reverse this, you could grab the character... int x=y.charAt(0); then subtract 48, but that assumes you have a digit 0-9 in the first place. Much better is: int x=Integer.parseInt("5"); Hope that … | |
Re: If you use an IDE like eclipse, you can JAR it there, by right clicking on project, then 'Export' If you want to convert into an exe file, its probably easiest to use a tool like... [URL]http://mpowers.net/executor/[/URL] The trial version of this always opens a command prompt, and doesn't let … | |
Re: Your question is a little vague, I guess you want a button to generate then open a JFrame. I can't answer your question specifically, but perhaps the following will help. 1. Use arrays or LinkedLists of buttons, so you can loop through them, you don't really want to write code … | |
Hi, I've installed: Microsoft Visual C# 2005 Express Microsoft Visual Web Developer SQL Server 2005 Express How am I supposed to use sql server? Can I use it from both C# 2005 Express and VWD? I haven't got a clue whats going on, I can't even uninstall sql server. Is … | |
Hi, I just got a new pen drive (USB 2), it works fine, but half the time when I put it in my computer my pc thinks its my Belkin Network Adapter, then I lose my internet connection, and takes forever to sort out. Is there anything I can to … | |
Re: Hmmm, Well I'm assuming you're using JPanel, or extending JPanel and thus using paintComponent(Graphics g) method. The you draw image using g.drawImage(image,x,y,this); So to remove the image, I would have some boolean or array that is updated when you press new game, then you can call repaint() on the JPanel … | |
Re: 2,544,277 is the exact answer. Just kidding, I don't know, the question is a little vague, but several million I think. | |
Hi, I'm trying to make a movie from a sequence of jpegs. I did have some software for it, on a trial version, but I forgot the name of it, and I have since formatted PC. The point is, I don't want a normal slide slow, I might need 10 … | |
Re: I'm assuming your using the command prompt. If so, why not use an IDE? Also, if you post your code, might be able to find problem. | |
Re: I've written a chess project... [URL]http://www.colin-java.co.uk/JChess/index.htm[/URL] And they are a lot of fun to make, but very time consuming, and you need to do research into it first, so if time is a constraint try checkers, or some other project. I will be happy to help if you choose to … |
The End.