Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.security.SecureRandom;
- import java.util.Timer;
- import java.util.TimerTask;
- public class TestMustenberg {
- private String[] massKeyWords = {"один", "апельсин", "весна", "сложность", "армия", "вечеринка"};
- private String result;
- private int attentionValue = 0;
- private final String AB = "0123456789Аыаофщшпоукфкпжщзуофкзщпкофщузжопкзщжфущокзщж";
- private SecureRandom rnd = new SecureRandom();
- private Timer timer = new Timer();
- public String getResult(){
- for(int i = 0; i < massKeyWords.length; i++){
- result = result + randomString(6) + massKeyWords[i];
- }
- return result;
- }
- public String randomString( int len ){
- StringBuilder sb = new StringBuilder( len );
- for( int i = 0; i < len; i++ )
- sb.append( AB.charAt( rnd.nextInt(AB.length()) ) );
- return sb.toString();
- }
- public void addatteintionvalue(){
- attentionValue += 10;
- }
- public void update(){
- timer.schedule(new TimerTask() {
- @Override
- public void run() {
- getAttentionValue();
- }
- },2*60*1000 );
- }
- public int getAttentionValue(){
- return attentionValue;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement