The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled Java Code
Posted by: YO | May 14, 2011 @ 1:57am
Java Code
[
Download
]
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package pe90; import java.util.ArrayList; import java.util.Arrays; /** * * @author Vista */ public class Main { static String[] squares = {"01","04","09","16","25","36","49","64","81"}; static ArrayList<int[]> dice1Combos = new ArrayList(); static ArrayList<int[]> dice2Combos = new ArrayList(); public static void main(String[] args) { for (int i = 0; i < 10; i++) { for (int j = i+1; j < 10; j++) { for (int k = j+1; k < 10; k++) { for (int l = k+1; l < 10; l++) { for (int m = l+1; m < 10; m++) { for (int n = m+1; n < 10; n++) { int[] dice1 = {i, j, k, l, m, n}; dice1Combos.add(dice1); dice2Combos.add(dice1); } } } } } } System.out.println("Done Generating List"); System.out.println(dice1Combos.size()); for (int i = 0; i < dice1Combos.size(); i++) { int[] temp = dice1Combos.get(i); for (int j= 0; j < temp.length; j++) { if (temp[j]==6 || temp[j] ==9){ temp[j]=-1; } } } // for (int i= 0; i < dice1Combos.size(); i++) { // int[] temp = dice1Combos.get(i); // System.out.print("["); // for (int j= 0; j < temp.length; j++) { // System.out.print(temp[j]+","); // } // System.out.println("]"); // } for (int i= 0; i < dice1Combos.size(); i++) { int[] temp1 = dice1Combos.get(i); for (int j= 0; j < dice1Combos.size(); j++) { int[] temp2= dice1Combos.get(j); int tempCount = 0; for (int k= 0; k < temp1.length; k++) { for (int l= 0; l < temp2.length; l++) { String temp3 = String.valueOf(temp1[k]) + String.valueOf(temp2[l]); for (int m = 0; m < squares.length; m++) { if (temp3.equals(squares[m])) { tempCount++; } } } } if(tempCount==9){ System.out.println("Woo"); } } } } }
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.43 / 8
42 Votes
http://codebin.yi.org/1266
page generated in 0.01 seconds