We have to program chess moves using Forsyth Edwards Notation ..
Type: Posts; User: ManInTheMiddle
We have to program chess moves using Forsyth Edwards Notation ..
No, there's no forums what so ever. It's a pain I know. Just thought I'd give this a try..
Thanks for the info..
We have to design moves for a ChessWorld and upload them to the world.
This might explain it a bit better
CA318 practical
or this
The World-Wide-Mind project
HI,
I'm not sure which section this would go in.
I have to write a ChessMind for an assignment. It's for a ChessWorld where minds can run each other and take each others pieces.
I need...
Cheers thanks for that..
Got it working
Greatly appreciated...
I don't quite follow. I'm not too sure why this is happening..
hi,
I have this completed and working now except for an error when a client disconnects..
import java.net.*;
import java.io.*;
import java.util.*;
Cheers, rooky mistake. Much appreciated..
Got it i needed to change
private ArrayList <ServerThread> nameList;
when I print out name it prints data but the ArrayList "nameList" is null, so, I think that's causing it.
I'v tried a few other things and the same error, it doesn't want to let me add data to...
my private String name = null. I think this is causing it.
I'v noticed that "name" should be reading in data just before the NPE error ( name = in.readInput), so, I think my client code needs to...
The private String name is null. But it should be receiving data from
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
name = in.readLine();
It should be adding a Clients name if the name doesn't already exist, see previous post.
I'v an ArrayList<String> nameList that should be getting the client from clientList.add(client);
So,...
Exception in thread "ServerThread" java.lang.NullPointerException
at ServerThread.run(Server.java:36)
it's the
if(!nameList.contains(name)) // line 36
{
nameList.add(name);...
so, I'v come up with this but it's showing a NullPointerException. Any suggestions?
class ServerThread extends Thread
{
private Socket socket;
private String name, message;
private...
Ah cool, much appreciated man.. I've never coded like that before so it's a bit tricky to get my head around..
I don't quite follow. Can I add different data types ? As i'm adding Sockets and Strings.
would I use?
ArrayList<ClassName> ListName = new ArrayList<>();
Right, so, I'v come up with this
class ServerStatus {
private final ArrayList<Socket> clients;
private final ArrayList<String> names;
private final ArrayList<String> messages;
...
Actually, this class is just to save the number of connections. So, it displays on the server eg Client 1... Client 2...Client 3 then if someone leaves the chat it decrease eg. Client 2... Client 1...
I came up with this Data Structure
class CountConnections extends Thread{
private ArrayList<Socket> connections = new ArrayList<>();
private Socket socket;
CountConnections(){...
Can this be done in the ServerThread class?
Cheers, I'll give it a go. Much appreciated..
--- Update ---
I have, class ServerThread and class Server in my Server, can it be done in the ServerThread? As the ServerThread class holds the...
Sorry, I meant an ArrayList<Socket> ?
what would I use to hold the clients?
a socket Array?
I have a server/client written. At the moment it's replying to individual clients (User one receives user one's post only) and I need multiple users to receive all posts.
Server
import...