id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
578fb02e-88ff-4ca6-8556-d86f65915ffa | public String getColor() {
return this.color;
} |
27e259d4-72ed-4b9c-9caf-2ef7f64ba642 | public void setColor(String color) {
this.color = color;
} |
34bbbe4f-e2aa-4949-bf3c-6be6f2eaf64c | public int getValue() {
return value;
} |
af279ca4-10c1-41a4-b2e2-f2003006d5dd | public void setValue(int value) {
this.value = value;
} |
352b4408-4100-4b23-9a77-40f70af97c86 | public Talon()
{
cartes = new LinkedList<Card>();
} |
282da5a6-08b4-4d74-946d-d37bb8f5f225 | public List<Card> getCartes() {
return cartes;
} |
6b499bdd-ab3c-4dcb-9ae0-09af640e3ca6 | public void setCartes(List<Card> cartes) {
this.cartes = cartes;
} |
921f0ec1-a853-455a-a948-9b809960cc0e | public CartePasseTour(String color, int value)
{
super(color, value);
// this.color = color;
// this.value = value;
this.type = "Carte Passe ton tour";
} |
94c8ba00-7ea2-44b0-a760-7ed43be1b692 | public String getColor() {
return this.color;
} |
8cba3297-0ca1-4f9e-b4c8-8d2f063cde8c | public void setColor(String color) {
this.color = color;
} |
29639e53-c380-4dd3-ae48-7ba59945747a | public int getValue() {
return value;
} |
f5a0758f-ac39-4592-8f7e-0c9ad27dc8fe | public void setValue(int value) {
this.value = value;
} |
a52dd456-d446-4a3c-9ed4-220d1220308b | public CarteInverse(String color, int value)
{
super(color, value);
// this.color = color;
// this.value = value;
this.type = "Carte Inverse";
} |
83ed6ee6-5381-4c5a-9c29-c0f3d42a0cc8 | public String getColor() {
return this.color;
} |
5b9e6e61-a6b8-49ca-9b20-73d0e44107ed | public void setColor(String color) {
this.color = color;
} |
2096f2a6-53bf-4ebb-b5d8-7040db832518 | public int getValue() {
return value;
} |
d6be2591-a263-4af4-aa89-f0bdbfdce058 | public void setValue(int value) {
this.value = value;
} |
84e798c4-2873-4d20-b90b-8608d2ec607a | public CarteCouleur(String color, int value)
{
super(color, value);
// this.color = color;
// this.value = value;
this.type = "Carte normale";
} |
dada71e6-c285-42bf-8a03-42928d7dd08a | public String getColor() {
return this.color;
} |
cf1a047c-7a6c-4b0b-a0c6-da070374bfd0 | public void setColor(String color) {
this.color = color;
} |
47039922-7b55-4805-8f77-ebc1c375da34 | public int getValue() {
return value;
} |
a2b53ca3-2948-4b39-9df1-661a21dfe697 | public void setValue(int value) {
this.value = value;
} |
e6a774c0-f5df-4459-9d7a-9755d42e5e0e | public CarteJoker()
{
super("Black", 50);
this.type = "Carte Joker";
} |
6e6d700c-5c71-4a9b-bc47-01e7481c5519 | public String getColor() {
return this.color;
} |
64487589-e7ae-4725-9da5-760febfedc17 | public void setColor(String color) {
this.color = color;
} |
bb8bcdaf-ccc5-45b0-80d4-d98ca5edb825 | public int getValue() {
return value;
} |
c571cab1-b8f4-4c78-b542-aaa69daf89c1 | public void setValue(int value) {
this.value = value;
} |
84f0fc4a-4827-4de7-975d-cd579f5ff0a2 | public static void main(String[] args)
{
int nombreHumain;
int nombreJoueur;
Scanner sc = new Scanner(System.in);
// Scanner sc2 = new Scanner(System.in);
Jeu partieDeUNO;
System.out.print("Bienvenue dans le jeu de UNO\n\n");
System.out.print("Combien de joueur (humain + IA) ?");
nombreJoueur = ... |
5eccdebe-9c40-4910-9c30-198ef8d83292 | public Joueur(String nom, Jeu partie)
{
poigne = new LinkedList<Card>();
score = 0;
this.nom = nom;
this.partie = partie;
aDitUNO = false;
} |
8734b126-a57f-442a-aff2-e651599df444 | public LinkedList getPoigne() {
return poigne;
} |
0f43d399-5202-4b37-b7e5-e2e8a1f7ff80 | public void setPoigne(LinkedList poigne) {
this.poigne = poigne;
} |
a169ebe8-b73e-441f-b847-71dbe35ce8a6 | public int getScore() {
return score;
} |
4e98e2a6-d97d-4574-ad8e-ab2ff91be82c | public void setScore(int score) {
this.score = score;
} |
3f39a3a9-14b7-4382-8234-1ec15dc1eadd | public String getNom() {
return nom;
} |
defeb0b7-a4b3-46fd-a37b-5bc1dea533c7 | public void afficherCartes()
{
int i = 0;
ListIterator<Card> li = poigne.listIterator();
while(li.hasNext())
{
System.out.println("Carte No" + i);
((Card)(li.next())).affichageCarte();
i++;
}
} |
80b167ec-3705-4c19-af46-871c87c8adf2 | public boolean estJouable(Card carte)
{
if((partie.getTalon().getCartes().get(0).getColor() == carte.getColor())||
(partie.getTalon().getCartes().get(0).getValue()== carte.getValue()))
return true;
if (carte.getColor() == "black")
return true;
return false;
} |
15a36795-bfc0-4bc9-b024-bf4f4873472c | public void affichageTexte()
{
System.out.print("Joueur : " + nom + "\n" );
afficherCartes();
} |
6fd6e43e-3203-4c74-8b87-635deefe04f8 | public void jouer()
{
int reponse;
Scanner sc = new Scanner(System.in);
System.out.println("ca marche pas!\n");
System.out.println("Vos cartes : \n");
System.out.println("\nQuelle carte souhaitez vous jouer ?\n");
reponse = sc.nextInt();
} |
a125c843-e1f4-4561-8fd6-130434b29076 | public String getColor() {
return color;
} |
7d3366fb-7bb4-463a-b6b0-493946a46fbe | public void setColor(String color) {
this.color = color;
} |
174c2e1d-b433-47b9-bfee-a97c50e3f448 | public int getValue() {
return value;
} |
6f48e1d3-edbb-4bb7-8065-02f9e7d84d8a | public void setValue(int value) {
this.value = value;
} |
80deeb57-3991-4876-a766-f46023ebb9b8 | public Card(String color, int value)
{
this.color = color;
this.value = value;
} |
8c35d1b3-0774-48a2-8992-4c7b3c83af93 | public void affichageCarte()
{
System.out.print(type + " - " + color + " - " + value + "\n");
} |
9c8bdefc-43ea-4382-bd5d-b7ec7af07258 | public JoueurHumain(String nom, Jeu partie)
{
super(nom, partie);
} |
2d95de77-66fe-4fc7-b623-19abfbafc7b8 | public void selectionnerCarte()
{
affichageTexte();
} |
c0e1b985-c93f-4dca-bb49-b9d9021d1ce9 | public boolean poserCarte(int index)
{
if(estJouable(poigne.get(index)));
{
//partie.setPioche(pioche);
return false;
}
} |
027a4c9b-bea8-40b6-a34d-356ccf2f7a17 | public void jouer()
{
Scanner sc = new Scanner(System.in);
int reponse;
System.out.println("Quelle action voulez vous effectuer ?\n");
System.out.println("- 1 ) Jouer une carte ?\n");
System.out.println("- 2 ) Piocher une carte \n");
System.out.println("- 3 ) Dire UNO \n");
System.out.println("- 4 ... |
4be121f8-efa9-4957-b9bf-e4d26dcec06a | public CarteSuperJoker()
{
super("Black", 50);
this.type = "Carte +4";
} |
b9d4c50e-4743-423e-b0be-2fc9abd882dd | public String getColor() {
return this.color;
} |
70bef6f0-5937-413b-aab5-1d0af9a07483 | public void setColor(String color) {
this.color = color;
} |
373f5e19-abd2-4fe9-8485-3bff23630c75 | public int getValue() {
return value;
} |
193bafe6-25ab-4d47-8a75-76f8974989c1 | public void setValue(int value) {
this.value = value;
} |
a3d2400e-721f-4e56-918a-cb930b15125d | public GenericStack_array(int size){
tarray = (T[]) new Object[size];
} |
191b0c43-2c6c-4a83-9fbd-3f9c0eb96b2c | public void push(T item){
if(position == tarray.length){
System.out.println("array size increasing");
T[] temparray = (T[]) new Object[(tarray.length*2)];
for(int i=0; i<position; i++){
temparray[i] = tarray[i];
}
tarray = temparray;
}
tarray[position] = item;
position++;
} |
da1566a3-f7f6-4e9c-8b55-1dfd71700d7d | public Object pop(){
position--;
Object result = tarray[position];
if(position < (tarray.length/4)){
System.out.println("array size decreasing");
T[] temparray = (T[]) new Object[(tarray.length/2)];
for(int i=0; i<position; i++){
temparray[i] = tarray[i];
}
tarray = temparray;
}
return ... |
9385fdb4-b158-413a-9e76-82d72019ed3d | public boolean isEmpty(){
if(position == 0)
return true;
return false;
} |
41917da2-93e3-4035-80fc-cd8b2408fd35 | public int size(){
return position;
} |
2eca5c23-df64-4ad1-85ee-00c422190f3d | public Node(T item, Node next){
this.item = item;
this.next = next;
} |
37915ed2-1b44-4ce3-ac29-a5d1d1fac0c5 | public void push(T stringarray){
first = new Node(stringarray,first);
N++;
} |
90ab7eba-a7a0-48c7-93d5-689d1e8bb133 | public T pop(){
T result = first.item;
first = first.next;
N--;
return result;
} |
46160462-e2b9-4db9-bfd6-4dc4113d77d5 | public boolean isEmpty(){
if(N==0)
return true;
return false;
} |
b82ad90d-6af3-45cc-9c8c-75ff2f54ce60 | public int size(){
return N;
} |
2ecce73b-096c-4d13-86f4-320d12024866 | public static void main(String[] args) {
object_array();
System.out.println("###########################");
object_linkedlist();
} |
3b0a73d9-3ebf-4425-bfc2-d1497d3c63bd | private static void object_array(){
int testsize = 11;
//Integer part
GenericStack_array<Integer> intarray = new GenericStack_array<Integer>(testsize);
for(int i = 0; i < testsize; i++){
intarray.push(i);
System.out.println("position = "+intarray.position+" ; Value = "+i);
}
System.out.prin... |
c923f5f3-abd1-43d3-8e67-7eda52051de8 | private static void object_linkedlist(){
//Integer part
int[] intarray = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};
GenericStack_linkedlist<Integer> intnode = new GenericStack_linkedlist<Integer>();
for(int i=0; i<intarray.length; i++){
System.out.println("Node item = "+intnode.N+" ;");
intnode.... |
d3c58b36-2483-4381-aec9-7f2adafbe399 | public static void main(String [] args) {
try {
byte[] encoded = Files.readAllBytes(Paths.get("textfile.txt"));
filestring = new String(encoded,Charset.defaultCharset());
words = filestring.split("[-!~\\s]+");
for(String word : words){
uniquewor... |
668e201c-5b0d-4a7b-8d14-ebb253ec968f | public static void main(String [] args) {
try {
byte[] encoded = Files.readAllBytes(Paths.get("textfile.txt"));
filestring = new String(encoded, Charset.defaultCharset());
words = filestring.split("[-!~\\s]+");
for(String word : words){
if(unique... |
2710aceb-a50e-40d5-b5c5-8ba19a27f401 | public static void main(String[] args) {
List<String> numberslist = new ArrayList<String>(Arrays.asList(args));
Collections.sort(numberslist);
System.out.println("Maximum: "+maximum(numberslist));
System.out.println("Median: "+median(numberslist));
System.out.println("StandardDe... |
bcdf57ec-3ae8-42b9-a5c4-744983cb3cd3 | private static String maximum(List<String> numberslist){
return numberslist.get(numberslist.size() - 1);
} |
cd6bf518-8a27-4bdb-a512-bb6686851df2 | private static String median(List<String> numberslist){
String result = null;
if(numberslist.size()%2==0){
int middle = numberslist.size() / 2;
int middleright = Integer.parseInt(numberslist.get(middle));
int middleleft = Integer.parseInt(numberslist.get(middle - 1));... |
80ff01a4-62f7-47eb-bf6b-ccc9d31aa145 | private static String standard_deviation(List<String> numberslist){
int total = 0;
for(int i=0; i<numberslist.size(); i++){
total += Integer.parseInt(numberslist.get(i));
}
//wrong?
String result = Integer.toString(total/numberslist.size());
return result;
... |
88c88c36-5ddc-46d9-89e7-4576c515710d | public static void main(String[] args) throws IOException, InterruptedException{
String searchterm = null;
int snippetlength = 2;
if(args.length > 1){
searchterm = args[0];
if(Integer.parseInt(args[1])>=0)
snippetlength = Integer.parseInt(args[1]);
... |
46cf2cd3-7830-4e73-8273-cbec052331ca | public static double algorithmList(List<String> wordlist, int times_file, String searchterm, int snippetlength) throws IOException{
/*
*
*/
Stopwatch timer = new Stopwatch();
for(int i = 0; i < times_file; i++){
BufferedReader br = new BufferedReader(new FileReader(... |
4ef48819-d239-4d11-95d9-5e60d01eabe5 | public static void main(String[] args) {
String searchterm = "a-wringing";
try {
Stopwatch timer = new Stopwatch();
LinearProbingHashST<String, Integer> st = new LinearProbingHashST<String, Integer>();
byte[] encoded = Files.readAllBytes(Paths.get("dickens.txt"));
... |
c5684606-b3ee-47e8-b590-3aa2fe5933ad | public static void main(String[] args) {
String searchterm = "a-wringing";
try {
Stopwatch timer = new Stopwatch();
SeparateChainingHashST<String, Integer> st = new SeparateChainingHashST<String, Integer>();
byte[] encoded = Files.readAllBytes(Paths.get("dickens.txt"... |
cfe99210-0c22-4fb9-aa98-f43f58a2c49e | public Node(int item, Node next){
this.item = item;
this.next = next;
} |
7ea08208-e637-4e9f-be52-9325fa7f3f97 | public void push(int item){
first = new Node(item,first);
N++;
} |
e48570d4-a1bc-4b1e-8c07-401b3ddebfc8 | public int pop(){
int result = first.item;
first = first.next;
N--;
return result;
} |
40a8e345-35e4-4b9c-a968-97aace3d0aff | public boolean isEmpty(){
if(N==0)
return true;
return false;
} |
802b3a4d-9cf9-403d-87bb-2268d3e78d1f | public int size(){
return N;
} |
0e9be8f1-8ae6-4e78-aa91-92d5bdf4d411 | public static void main(String[] args) {
ints_array();
ints_linkedlist();
} |
5a19f23e-ceb3-4b94-8bc1-63e2a97add33 | private static void ints_array(){
StackOfInts_array intarray = new StackOfInts_array(testsize);
for(int i = 0; i < testsize; i++){
intarray.push(i);
System.out.println("position = "+intarray.position+" ; Value = "+i);
}
System.out.println("-------------------------------------");
for(int i = ... |
56e6934c-a6da-40e1-98a2-dbb8b609c263 | private static void ints_linkedlist(){
int[] intarray = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};
StackOfInts_linkedlist intnode = new StackOfInts_linkedlist();
for(int i=0; i<intarray.length; i++){
System.out.println("Node item = "+intnode.N+" ;");
intnode.push(intarray[i]);
}
System.out.pri... |
1037d913-682b-4263-bae6-92481fa6b3c6 | public StackOfInts_array(int size){
intarray = new int[size];
} |
b2f7d4f5-11f5-4378-9587-f7f2df611aa0 | public void push(int item){
if(position == intarray.length){
System.out.println("array size increasing");
int[] temparray = new int[(intarray.length*2)];
for(int i=0; i<position; i++){
temparray[i] = intarray[i];
}
intarray = temparray;
}
intarray[position] = item;
position++;
} |
25aa4f06-04f9-4527-b4e0-2e299e7fff38 | public int pop(){
position--;
int result = intarray[position];
if(position < (intarray.length/4)){
System.out.println("array size decreasing");
int[] temparray = new int[(intarray.length/2)];
for(int i=0; i<position; i++){
temparray[i] = intarray[i];
}
intarray = temparray;
}
return res... |
29c4d7fc-f243-4698-9332-c645cd1e3195 | public boolean isEmpty(){
if(position == 0)
return true;
return false;
} |
c43403ad-272f-4901-8cd4-d4137f96edf5 | public int size(){
return position;
} |
638924bb-8506-47e8-8d34-ed9ee9c3f10b | public Yhdistelma(Jatsikasi k){
super(k);
pisteet = 0;
nimi = null;
Arrays.sort(nopat); // Järjestetään nopat nousevaan järjestykseen
} |
4b3a2cc5-783d-4143-8c77-e06f11eb3ce2 | public Yhdistelma(Noppa[] n, int a, Jatsiyhdistelma b){
super(n);
pisteet = a;
nimi = b;
Arrays.sort(nopat); // Järjestetään nopat nousevaan järjestykseen
} |
09a1da4d-a5b1-4c9d-85c4-cd23121a413d | public ArrayList<Yhdistelma> getYhdistelmat(){
ArrayList<Yhdistelma> a = new ArrayList<Yhdistelma>();
int points=0;
if(ykkoset()){
for(int i=0; i<5; i++){
if (nopat[i].getValue()==1){
points++;
}
}
a.add(new Yhdistelma(nopat, points, Jatsiyhdistelma.YKKOSET));
points=0;
}
if(kakkoset(... |
bd3d6b7d-8b11-4ccf-a7f6-a84664e1e2a1 | public boolean ykkoset(){
if(nopat[0].getValue()==1){
return true;
}
return false;
} |
33b066e5-8d76-4685-9c02-602cc91b2dd8 | public boolean kakkoset(){
for(int i=0; i<5; i++){
if(nopat[i].getValue()==2){
return true;
}
}
return false;
} |
9509759c-b38d-4c83-b46b-a39c7a98835c | public boolean kolmoset(){
for(int i=0; i<5; i++){
if(nopat[i].getValue()==3){
return true;
}
}
return false;
} |
6b93f068-9fdb-4015-86ae-adabcd68c0d2 | public boolean neloset(){
for(int i=0; i<5; i++){
if(nopat[i].getValue()==4){
return true;
}
}
return false;
} |
2efaaac1-54e0-4ed6-a24d-50443556c4a5 | public boolean viitoset(){
for(int i=0; i<5; i++){
if(nopat[i].getValue()==5){
return true;
}
}
return false;
} |
b3e3da39-d044-4a5b-bdf8-9de0a285777c | public boolean kuutoset(){
for(int i=0; i<5; i++){
if(nopat[i].getValue()==6){
return true;
}
}
return false;
} |
fbc4a07f-59d7-43ea-9c44-1c3c17d3ad5e | public boolean pari(){
for(int i=0; i<4; i++){
if(nopat[i].getValue()==nopat[i+1].getValue()){
return true;
}
}
return false;
} |
992ac616-147d-407d-b84f-d9be58ad4f24 | public boolean kaksiParia(){
int count = 0;
for(int i=0; i<4; i++){
if(nopat[i].getValue()==nopat[i+1].getValue()){
count++;
i++;
}
}
if(count==2){
return true;
}
return false;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.