Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

86
LINES

< > BotCompany Repo | #1010777 // A penny earned... (math problem solver) by degreespwnu

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (123L/2K).

1  
!7
2  
3  
// by https://www.youtube.com/user/degreespwnu
4  
// Solution for: https://www.youtube.com/watch?v=EIWbhB4uLVY (Scam School)
5  
6  
p {
7  
  for(int a=1;a<10;a++){
8  
     for(int p=1;p<10;p++){
9  
       if(!(p==a)){
10  
         
11  
       
12  
    	 for(int e=1;e<10;e++){
13  
    	   if(!(e==p || e==a)){
14  
    	     
15  
    	   
16  
     		for(int n=0;n<10;n++){
17  
     		  if(!(n==e || n==p || n==a)){
18  
     		    
19  
     		  
20  
            for(int y=0;y<10;y++){
21  
              if(!(y==n || y==e || y==p || y==a)){
22  
     		        
23  
     		      
24  
              for(int s=1;s<10;s++){
25  
                if(!(s==y || s==n || s==e || s==p || s==a)){
26  
     		          
27  
     		        
28  
                for(int v=0;v<10;v++){
29  
                  if(!(v==s || v==y || v==n || v==e || v==p || v==a)){
30  
     		            
31  
     		          
32  
                  for(int d=0;d<10;d++){
33  
                    if(!(d==v || d==s || d==y || d==n || d==e || d==p || d==a)){
34  
     		              
35  
     		            
36  
                    for(int i=1;i<10;i++){
37  
                      if(!(i==d || i==v || i==s || i==y || i==n || i==e || i==p || i==a)){
38  
     		                
39  
     		              
40  
                      for(int r=0;r<10;r++){
41  
                        if(!(r==d || r==v || r==s || r==y || r==n || r==e || r==p || r==a)){
42  
                          
43  
                        int aCalc = a;
44  
                        String pennyString = String.valueOf(p) + String.valueOf(e) + String.valueOf(n) + String.valueOf(n) + String.valueOf(y);
45  
                        int pennyCalc = Integer.parseInt(pennyString);
46  
                        String savedString = String.valueOf(s) + String.valueOf(a) + String.valueOf(v) + String.valueOf(e) + String.valueOf(d);
47  
                        int savedCalc = Integer.parseInt(savedString);
48  
                        String isString = String.valueOf(i) + String.valueOf(s);
49  
                        int isCalc = Integer.parseInt(isString);
50  
                        String earnedString = String.valueOf(e) + String.valueOf(a) + String.valueOf(r) + String.valueOf(n) + String.valueOf(e) + String.valueOf(d);
51  
                        int earnedCalc = Integer.parseInt(earnedString);
52  
                        
53  
                        
54  
                        int earnedGuess = aCalc + pennyCalc + savedCalc + isCalc + aCalc + pennyCalc;
55  
                        if(earnedCalc == earnedGuess){
56  
                          System.out.println("A solution was found:");
57  
                          System.out.println(aCalc);
58  
                          System.out.println(pennyCalc);
59  
                          System.out.println(savedCalc);
60  
                          System.out.println(isCalc);
61  
                          System.out.println(aCalc);
62  
                          System.out.println(pennyCalc);
63  
                          System.out.println("_________________");
64  
                          System.out.println(earnedCalc);
65  
                        }
66  
                      }
67  
  }
68  
                    }
69  
  }
70  
                  }
71  
  }
72  
                }
73  
  }
74  
              }
75  
  }
76  
            }
77  
  }
78  
     		}
79  
  }
80  
    	 }
81  
  }
82  
     }
83  
  }
84  
  }
85  
  
86  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1010777
Snippet name: A penny earned... (math problem solver) by degreespwnu
Eternal ID of this version: #1010777/4
Text MD5: b32204ab798d04dccf28762cfda7e81d
Transpilation MD5: fdbe76a16ccce320f6e786f0960a4b8b
Author: stefan
Category: javax / puzzles
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-02 01:31:13
Source code size: 3175 bytes / 86 lines
Pitched / IR pitched: No / No
Views / Downloads: 554 / 1090
Version history: 3 change(s)
Referenced in: [show references]