Okay, so I know what I have to do - at least so far.
I've just taken screenshots of all the tiles from the following link.
And so I'll have to create one "wall" that would represent the four that would have been shown. Just mirroring the deck class, I would have to create a linked list using the following information: Suit, Style, and ImageIcon (which are all done in the folder(s)).
After, I should run a shuffle method which will shuffle the class - hopefully 2000 times or so?
Then, I can separate that deck (using the takeCard) method into 4 separate linked lists for the player's hand(s).
Monday, 31 March 2014
Monday, 24 March 2014
Creating LinkedList
So I asked Ryk to give me an example, and he created:
Main Class is called Quack (and will have to create a linked list using the list class).
Inside the List Class:
class List {
Node head;
List()
{
head=null;
}
public void insert(String n, String p, int a, String b)
{
Node newNode = Node(n,p,a,b);
if(head==null) head=newNode;
else
{
}
}
}
Main Class is called Quack (and will have to create a linked list using the list class).
Inside the List Class:
class List {
Node head;
List()
{
head=null;
}
public void insert(String n, String p, int a, String b)
{
Node newNode = Node(n,p,a,b);
if(head==null) head=newNode;
else
{
}
}
}
Inside the Node Class:
class Node {
String name;
String phoneNumber;
int age;
String birthday;
Node next;
Node(String n, String p, int a, String b)
{
name=n;
phoneNumber=p;
age=a;
birthday=b;
}
}
In other words, when you create a linked list thing, you have to use the "LIST" Class...
Monday, 17 March 2014
Linked List(s)
Okay, so I'm thinking about the Linked List Thing, and the 5.01 lesson shows an example using a separate class. I suppose that means that I can use the Java Linked List Class.
So each tile has to contain the following information:
- Style
- Bamboo (1-9) suit = 0. number = valueOfThing
- Stones (1-9) suit = 1. number = valueOfThing
- Numbers (1-9) suit = 2. number = valueOfThing
- Directions suit = 3.
- North number = 0;
- East number = 1
- South number = 2
- West number = 3
- Other suit = 4.
- Prosperity number = 0
- Red Centre number = 1
- White blank number = 2
There will also have to be 2 dice values that show up on the screen (will definitely be on a gooey).
So each of the hand(s) is a separate array list, and the tile(s) that you pick from is also one.
I'm also going to need the following buttons:
- Pong (take it to get a triple)
- Sheung (take it to get a consecutive number)
- Gong (take it to get 4 in a row)
- Sik Woo (win!)
Planning
So I've been thinking a bit about this program, and I'm thinking...
Four linked lists (or a 2D array of them) is going to be needed to represent the player's hands, and one that represents the big 'deck' out there.
So every time a user wants to pick up a tile, then I will have to take the top thing off of the list. I'm not going to worry too much about graphics now, because it's a lot of work to remove each tile.
And every time the user pairs something up (like an eye or a triplet), the user has to choose one to throw out (perhaps a drop down menu or pressing on the physical tiles), and then the list has to be resorted again so it is all in the right order.
Perhaps something more like this (http://fs02.androidpit.info/ass/x90/11319390-1379636282506.jpg), where you don't have to use the 144 tile-thing...that's a lot of work, and unless I'm making an app (which I will eventually convert it over), but it's too much work for a project due so soon.
Four linked lists (or a 2D array of them) is going to be needed to represent the player's hands, and one that represents the big 'deck' out there.
So every time a user wants to pick up a tile, then I will have to take the top thing off of the list. I'm not going to worry too much about graphics now, because it's a lot of work to remove each tile.
And every time the user pairs something up (like an eye or a triplet), the user has to choose one to throw out (perhaps a drop down menu or pressing on the physical tiles), and then the list has to be resorted again so it is all in the right order.
Perhaps something more like this (http://fs02.androidpit.info/ass/x90/11319390-1379636282506.jpg), where you don't have to use the 144 tile-thing...that's a lot of work, and unless I'm making an app (which I will eventually convert it over), but it's too much work for a project due so soon.
Tuesday, 4 March 2014
Settled!
Okay, it's settled. Like TOTALLY settled. I'm doing mahjong! OMR.
THIS IS SO EXCIIITING.
I mean, eventually, after doing the Java Version, I can hopefully eventually convert it into an iOS App or an Apple App. OMR I should so do that. Then there'd actually be some legit apple thing up on the app store for decent price(s)! I'm not paying $10.99 for a game of Mahjong LOLs.
THIS IS SO EXCIIITING.
I mean, eventually, after doing the Java Version, I can hopefully eventually convert it into an iOS App or an Apple App. OMR I should so do that. Then there'd actually be some legit apple thing up on the app store for decent price(s)! I'm not paying $10.99 for a game of Mahjong LOLs.
Subscribe to:
Posts (Atom)