SHARE
TWEET

Untitled

a guest May 23rd, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package me.robin;
  2.  
  3. import me.jframe.JFrame;
  4.  
  5. import java.util.Random;
  6. import java.util.Timer;
  7. import java.util.TimerTask;
  8.  
  9. public class Main {
  10.     private String lastAction="";
  11.     private JFrame frame;
  12.     private javax.swing.JFrame jframe;
  13.     public static Main instance;
  14.  
  15.     public static void main(String[] args){
  16.         new Timer().schedule(new TimerTask() {
  17.             @Override
  18.             public void run() {
  19.  
  20.  
  21.                 instance=new Main();
  22.                 instance.jframe=new javax.swing.JFrame();
  23.                 instance.frame=new JFrame(instance.jframe);
  24.  
  25.  
  26.             }
  27.         },200);
  28.     }
  29.  
  30.     private String getAction(){
  31.         Random r =new Random();
  32.         Integer i = r.nextInt(4);
  33.  
  34.         String action = "";
  35.  
  36.         if (i==0){
  37.             action="Schere";
  38.         }else if (i==1){
  39.             action="Stein";
  40.         }else if (i==2){
  41.             action="Papier";
  42.         }else if (i==3){
  43.             action="Echse";
  44.         }else if (i==4) {
  45.             action="Spock";
  46.         }
  47.  
  48.         if (lastAction.equalsIgnoreCase(action)){
  49.  
  50.             action=getAction();
  51.             lastAction=action;
  52.  
  53.             return action;
  54.         }
  55.  
  56.         lastAction=action;
  57.         return action;
  58.     }
  59. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top