//count to 10
#include <iostream>
#include <string>
int main()
{
int i = 0;
beginning:
if (i < 10) {
std::cout << ++i << std::endl;
goto beginning;
}
else goto end;
end:
return 0;
}
@Override
public void afterTextChanged(Editable s) {
switch (paymentType) {
case 0:
if (s.length() == 9) etPaymentAmount.requestFocus();
break;
case 1:
if (s.length() == 9) etPaymentAmount.requestFocus();
break;
}
}
self.isOptionsVisible = ko.computed(function() {
if((self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
return true;
}
return false;
}, this);
self.isNameVisible = ko.computed(function() {
if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
return true;
}
return false;
}, this);
self.isBeforeAfterImagesVisible = ko.computed(function() {
if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
return true;
}
return false;
}, this);
self.isTooltipVisible = ko.computed(function() {
if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
return true;
}
return false;
}, this);
self.isLabelVisible = ko.computed(function() {
if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload') || (self.type() == 'info')) {
return true;
}
return false;
}, this);
self.isClassVisible = ko.computed(function() {
if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
return true;
}
return false;
}, this);
self.isStyleVisible = ko.computed(function() {
if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
return true;
}
return false;
}, this);
object orientation overrated. let's check the fields in several places ...
<input type="button" value="Go and fill later" onclick="javascript:window.location='<?php echo $url; ?>info.php'" />
Well, a is obsolete, let's do links as buttons!
UIButton * btn = [UIButton new];
[btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
//May god have mercy of me
[[btn titleLabel] setFont:[UIFont systemFontOfSize:14 weight:UIFontWeightMedium]];
[btn setTitle:[NSString stringWithFormat:@" %@ ", btnTxt] forState:UIControlStateNormal];
[btn sizeToFit];
[btn setTitle:btnTxt forState:UIControlStateNormal];
Why keep playing with label padding or insets when you can add spaces?
/// <summary>
/// Desctop constructor
/// </summary>
...
This is best XML commentary I found so far.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
O | O | O
-----------
O | O | O
-----------
O | O | O
*/
package tictactoe;
import java.util.Scanner;
public class TicTacToe {
/**
* @param args the command line arguments
* @throws java.lang.InterruptedException
*/
public static void main(String[] args) throws InterruptedException {
Scanner input = new Scanner(System.in);
String a1 = "1";
String a2 = "2";
String a3 = "3";
String a4 = "4";
String a5 = "5";
String a6 = "6";
String a7 = "7";
String a8 = "8";
String a9 = "9";
int inO;
int inX = 0;
boolean winner = false;
PrintBoard(a1,a2,a3,a4,a5,a6,a7,a8,a9);
System.out.printf("How to play - wait for your turn and when it comes write the number of the field that you want to draw in (from 1 to 9)\n");
System.out.printf("Player O's turn: ");
inO = input.nextInt();
while (true) {
switch (inO) {
case 1:
if (a1 == "1") {
a1 = "O";
}
break;
case 2:
if (a2 == "2") {
a2 = "O";
}
break;
case 3:
if (a3 == "3") {
a3 = "O";
}
break;
case 4:
if (a4 == "4") {
a4 = "O";
}
break;
case 5:
if (a5 == "5") {
a5 = "O";
}
break;
case 6:
if (a6 == "6") {
a6 = "O";
}
break;
case 7:
if (a7 == "7") {
a7 = "O";
}
break;
case 8:
if (a8 == "8") {
a8 = "O";
}
break;
case 9:
if (a9 == "9") {
a9 = "O";
}
break;
default:
System.out.printf("An error occured. Please accept it politely and restart the game.");
break;
}
System.out.printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
if (null != Winners(a1,a2,a3,a4,a5,a6,a7,a8,a9))switch (Winners(a1,a2,a3,a4,a5,a6,a7,a8,a9)) {
case "NONE":
if (a1 != "1" && a2 != "2" && a3 != "3" && a4 != "4" && a5 != "5" && a6 != "6" && a7 != "7" && a8 != "8" && a9 != "9") {
winner = true;
System.out.println("DRAW!");
Thread.sleep(3000);
break;
} else {
PrintBoard(a1,a2,a3,a4,a5,a6,a7,a8,a9);
System.out.printf("Player X's turn: ");
inX = input.nextInt();
break;
}
case "X":
winner = true;
System.out.println("X HAS WON!!!");
Thread.sleep(3000);
break;
case "O":
winner = true;
System.out.printf("O HAS WON!!!");
Thread.sleep(3000);
break;
default:
break;
}
if (winner) {
break;
}
switch (inX) {
case 1:
if (a1 == "1") {
a1 = "X";
}
break;
case 2:
if (a2 == "2") {
a2 = "X";
}
break;
case 3:
if (a3 == "3") {
a3 = "X";
}
break;
case 4:
if (a4 == "4") {
a4 = "X";
}
break;
case 5:
if (a5 == "5") {
a5 = "X";
}
break;
case 6:
if (a6 == "6") {
a6 = "X";
}
break;
case 7:
if (a7 == "7") {
a7 = "X";
}
break;
case 8:
if (a8 == "8") {
a8 = "X";
}
break;
case 9:
if (a9 == "9") {
a9 = "X";
}
break;
default:
System.out.printf("An error occured. Please accept it politely and restart the game.");
break;
}
System.out.printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
if (null != Winners(a1,a2,a3,a4,a5,a6,a7,a8,a9))switch (Winners(a1,a2,a3,a4,a5,a6,a7,a8,a9)) {
case "NONE":
if (a1 != "1" && a2 != "2" && a3 != "3" && a4 != "4" && a5 != "5" && a6 != "6" && a7 != "7" && a8 != "8" && a9 != "9") {
winner = true;
System.out.println("DRAW!");
Thread.sleep(3000);
break;
} else {
PrintBoard(a1,a2,a3,a4,a5,a6,a7,a8,a9);
System.out.printf("Player O's turn: ");
inO = input.nextInt();
break;
}
case "X":
winner = true;
System.out.println("X HAS WON!!!");
Thread.sleep(3000);
break;
case "O":
winner = true;
System.out.println("O HAS WON!!!");
Thread.sleep(3000);
break;
default:
break;
}
if (winner) {
break;
}
}
}
public static void PrintBoard(String f1, String f2, String f3, String f4, String f5, String f6, String f7, String f8, String f9) {
System.out.printf(" %s | %s | %s \n",f1,f2,f3);
System.out.printf(" ----------- \n");
System.out.printf(" %s | %s | %s \n",f4,f5,f6);
System.out.printf(" ----------- \n");
System.out.printf(" %s | %s | %s \n",f7,f8,f9);
System.out.printf(" \n");
}
public static String Winners(String f1, String f2, String f3, String f4, String f5, String f6, String f7, String f8, String f9) {
if (f1 == f2 && f2 == f3 && f3 == "O") {
return "O";
} else if (f4 == f5 && f5 == f6 && f6 == "O") {
return "O";
} else if (f7 == f8 && f8 == f9 && f9 == "O") {
return "O";
} else if (f1 == f4 && f4 == f7 && f7 == "O") {
return "O";
} else if (f2 == f5 && f5 == f8 && f8 == "O") {
return "O";
} else if (f3 == f6 && f6 == f9 && f9 == "O") {
return "O";
} else if (f1 == f5 && f5 == f9 && f9 == "O") {
return "O";
} else if (f3 == f5 && f5 == f7 && f7 == "O") {
return "O";
} else if (f1 == f2 && f2 == f3 && f3 == "X") {
return "X";
} else if (f4 == f5 && f5 == f6 && f6 == "X") {
return "X";
} else if (f7 == f8 && f8 == f9 && f9 == "X") {
return "X";
} else if (f1 == f4 && f4 == f7 && f7 == "X") {
return "X";
} else if (f2 == f5 && f5 == f8 && f8 == "X") {
return "X";
} else if (f3 == f6 && f6 == f9 && f9 == "X") {
return "X";
} else if (f1 == f5 && f5 == f9 && f9 == "X") {
return "X";
} else if (f3 == f5 && f5 == f7 && f7 == "X") {
return "X";
} else {
return "NONE";
}
}
}
There are so many problems with this...
int number = -1;
//todo: refactor this horse shit.
for (String res: results) {
if(number == -1){
if(res.toLowerCase().contains("ten") || res.contains("10") || res.contains("10") || res.contains("十") || res.contains("십")){
number = 10;
}
else if(res.toLowerCase().contains("nine") || res.contains("9") || res.contains("9") || res.contains("九") || res.contains("구")){
number = 9;
}
else if(res.toLowerCase().contains("eight") || res.contains("8") || res.contains("8") || res.contains("八") || res.contains("팔")){
number = 8;
}
else if(res.toLowerCase().contains("seven") || res.contains("7") || res.contains("7") || res.contains("七") || res.contains("칠")){
number = 7;
}
else if(res.toLowerCase().contains("six") || res.contains("6") || res.contains("6") || res.contains("六") || res.contains("육")){
number = 6;
}
else if(res.toLowerCase().contains("five") || res.contains("5") || res.contains("5") || res.contains("五") || res.contains("오")){
number = 5;
}
else if(res.toLowerCase().contains("four") || res.contains("4") || res.contains("4") || res.contains("四") || res.contains("사")){
number = 4;
}
else if(res.toLowerCase().contains("three") || res.contains("3") || res.contains("3") || res.contains("三") || res.contains("삼")){
number = 3;
}
else if(res.toLowerCase().contains("two") || res.contains("2") || res.contains("2") || res.contains("二") || res.contains("이")){
number = 2;
}
else if(res.toLowerCase().contains("one") || res.contains("1") || res.contains("1") || res.contains("一") || res.contains("일")){
number = 1;
}
}
}
refactor this horse shit.
private boolean isToRemove(byte b) {
byte[] toRemoveB = { -106 };
for(byte c : toRemoveB) {
if(b == c) {
return true;
}
}
return false;
}
it goes without saying...
if(year%100 === 79 ||
year%100 === 90 ||
year%100 === 1 ||
year%100 === 7 ||
year%100 === 18) {
if(month === 1) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 2) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 28);}}
if(month === 3) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 4) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 5) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 6) { while((day + 4)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 7) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 8) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 9) { while((day + 5)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 10) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 11) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 12) { while((day + 5)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 79 ||
year2%100 === 90 ||
year2%100 === 1 ||
year2%100 === 7 ||
year2%100 === 18) {
if(month2 === 1) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 2) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 28);}}
if(month2 === 3) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 4) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 5) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 6) { while((day2 + 4)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 7) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 8) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 9) { while((day2 + 5)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 10) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 11) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 12) { while((day2 + 5)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 79 ||
year3%100 === 90 ||
year3%100 === 1 ||
year3%100 === 7 ||
year3%100 === 18) {
if(month3 === 1) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 2) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 28);}}
if(month3 === 3) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 4) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 5) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 6) { while((day3 + 4)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 7) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 8) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 9) { while((day3 + 5)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 10) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 11) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 12) { while((day3 + 5)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
if(year%100 === 96) {
if(month === 1) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 2) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 29);}}
if(month === 3) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 4) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 5) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 6) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 7) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 8) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 9) { while((day + 4)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 10) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 11) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 12) { while((day + 4)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 96) {
if(month2 === 1) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 2) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 29);}}
if(month2 === 3) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 4) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 5) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 6) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 7) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 8) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 9) { while((day2 + 4)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 10) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 11) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 12) { while((day2 + 4)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 96) {
if(month3 === 1) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 2) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 29);}}
if(month3 === 3) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 4) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 5) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 6) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 7) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 8) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 9) { while((day3 + 4)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 10) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 11) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 12) { while((day3 + 4)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
if(year%100 === 85 ||
year%100 === 91 ||
year%100 === 2 ||
year%100 === 13 ||
year%100 === 19) {
if(month === 1) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 2) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 28);}}
if(month === 3) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 4) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 5) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 6) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 7) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 8) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 9) { while((day + 4)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 10) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 11) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 12) { while((day + 4)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 85 ||
year2%100 === 91 ||
year2%100 === 2 ||
year2%100 === 13 ||
year2%100 === 19) {
if(month2 === 1) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 2) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 28);}}
if(month2 === 3) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 4) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 5) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 6) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 7) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 8) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 9) { while((day2 + 4)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 10) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 11) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 12) { while((day2 + 4)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 85 ||
year3%100 === 91 ||
year3%100 === 2 ||
year3%100 === 13 ||
year3%100 === 19) {
if(month3 === 1) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 2) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 28);}}
if(month3 === 3) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 4) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 5) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 6) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 7) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 8) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 9) { while((day3 + 4)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 10) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 11) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 12) { while((day3 + 4)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
if(year%100 === 80 ||
year%100 === 8) {
if(month === 1) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 2) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 29);}}
if(month === 3) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 4) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 5) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 6) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 7) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 8) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 9) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 10) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 11) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 12) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 80 ||
year2%100 === 8) {
if(month2 === 1) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 2) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 29);}}
if(month2 === 3) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 4) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 5) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 6) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 7) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 8) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 9) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 10) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 11) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 12) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 80 ||
year3%100 === 8) {
if(month3 === 1) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 2) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 29);}}
if(month3 === 3) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 4) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 5) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 6) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 7) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 8) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 9) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 10) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 11) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 12) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
if(year%100 === 86 ||
year%100 === 97 ||
year%100 === 3 ||
year%100 === 14) {
if(month === 1) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 2) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 28);}}
if(month === 3) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 4) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 5) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 6) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 7) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 8) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 9) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 10) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 11) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 12) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year%100 === 92) {
if(month === 1) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 2) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 29);}}
if(month === 3) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 4) { while((day - 4)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 5) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 6) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 7) { while((day - 4)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 8) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 9) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 10) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 11) { while(day%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 12) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 86 ||
year2%100 === 97 ||
year2%100 === 3 ||
year2%100 === 14) {
if(month2 === 1) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 2) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 28);}}
if(month2 === 3) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 4) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 5) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 6) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 7) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 8) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 9) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 10) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 11) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 12) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 92) {
if(month2 === 1) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 2) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 29);}}
if(month2 === 3) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 4) { while((day2 - 4)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 5) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 6) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 7) { while((day2 - 4)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 8) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 9) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 10) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 11) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 12) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 86 ||
year3%100 === 97 ||
year3%100 === 3 ||
year3%100 === 14) {
if(month3 === 1) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 2) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 28);}}
if(month3 === 3) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 4) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 5) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 6) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 7) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 8) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 9) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 10) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 11) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 12) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 92) {
if(month3 === 1) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 2) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 29);}}
if(month3 === 3) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 4) { while((day3 - 4)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 5) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 6) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 7) { while((day3 - 4)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 8) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 9) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 10) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 11) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 12) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
if(year%100 === 81 ||
year%100 === 87 ||
year%100 === 98 ||
year%100 === 9 ||
year%100 === 17) {
if(month === 1) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 2) { while(day%7 ===0) {day=Math.ceil(Math.random() * 28);}}
if(month === 3) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 4) { while((day - 4)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 5) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 6) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 7) { while((day - 4)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 8) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 9) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 10) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 11) { while(day%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 12) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year%100 === 4) {
if(month === 1) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 2) { while(day%7 ===0) {day=Math.ceil(Math.random() * 29);}}
if(month === 3) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 4) { while((day - 5)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 5) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 6) { while(day%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 7) { while((day - 5)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 8) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 9) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 10) { while((day - 4)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
if(month === 11) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
if(month === 12) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 81 ||
year2%100 === 87 ||
year2%100 === 98 ||
year2%100 === 9 ||
year2%100 === 17) {
if(month2 === 1) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 2) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 28);}}
if(month2 === 3) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 4) { while((day2 - 4)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 5) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 6) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 7) { while((day2 - 4)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 8) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 9) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 10) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 11) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 12) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 4) {
if(month2 === 1) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 2) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 29);}}
if(month2 === 3) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 4) { while((day2 - 5)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 5) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 6) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 7) { while((day2 - 5)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 8) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 9) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 10) { while((day2 - 4)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
if(month2 === 11) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
if(month2 === 12) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 81 ||
year3%100 === 87 ||
year3%100 === 98 ||
year3%100 === 9 ||
year3%100 === 17) {
if(month3 === 1) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 2) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 28);}}
if(month3 === 3) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 4) { while((day3 - 4)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 5) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 6) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 7) { while((day3 - 4)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 8) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 9) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 10) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 11) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 12) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 4) {
if(month3 === 1) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 2) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 29);}}
if(month3 === 3) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 4) { while((day3 - 5)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 5) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 6) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 7) { while((day3 - 5)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 8) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 9) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 10) { while((day3 - 4)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
if(month3 === 11) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
if(month3 === 12) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
function downScaleCanvas(a, b) {
var c = Math.ceil,
d = Math.floor;
if (!(1 > b) || !(0 < b)) throw "scale must be a positive number <1 ";
var e = b * b,
f = a.width,
g = a.height,
h = d(f * b),
i = d(g * b),
j = 0,
k = 0,
l = 0,
m = 0,
n = 0,
o = 0,
p = 0,
q = 0,
r = 0,
s = 0,
t = 0,
u = 0,
v = 0,
x = 0,
y = 0,
z = !1,
A = !1,
B = a.getContext("2d").getImageData(0, 0, f, g).data,
C = new Float32Array(3 * h * i),
D = 0,
E = 0,
F = 0;
for (k = 0; k < g; k++)
for (n = k * b, r = 0 | n, o = 3 * r * h, A = r != (0 | n + b), A && (x = r + 1 - n, y = n + b - r - 1), j = 0; j < f; j++, l += 4) m = j * b, q = 0 | m, p = o + 3 * q, z = q != (0 | m + b), z && (u = q + 1 - m, v = m + b - q - 1), D = B[l], E = B[l + 1], F = B[l + 2], z || A ? z && !A ? (s = u * b, C[p] += D * s, C[p + 1] += E * s, C[p + 2] += F * s, t = v * b, C[p + 3] += D * t, C[p + 4] += E * t, C[p + 5] += F * t) : A && !z ? (s = x * b, C[p] += D * s, C[p + 1] += E * s, C[p + 2] += F * s, t = y * b, C[p + 3 * h] += D * t, C[p + 3 * h + 1] += E * t, C[p + 3 * h + 2] += F * t) : (s = u * x, C[p] += D * s, C[p + 1] += E * s, C[p + 2] += F * s, t = v * x, C[p + 3] += D * t, C[p + 4] += E * t, C[p + 5] += F * t, t = u * y, C[p + 3 * h] += D * t, C[p + 3 * h + 1] += E * t, C[p + 3 * h + 2] += F * t, t = v * y, C[p + 3 * h + 3] += D * t, C[p + 3 * h + 4] += E * t, C[p + 3 * h + 5] += F * t) : (C[p] += D * e, C[p + 1] += E * e, C[p + 2] += F * e);
var G = document.createElement("canvas");
G.width = h, G.height = i;
var H = G.getContext("2d"),
I = H.getImageData(0, 0, h, i),
J = I.data,
K = 0;
for (l = 0, p = 0; K < h * i; l += 3, p += 4, K++) J[p] = c(C[l]), J[p + 1] = c(C[l + 1]), J[p + 2] = c(C[l + 2]), J[p + 3] = 255;
return H.putImageData(I, 0, 0), G
}
dohhhhhh !!
if (i === 1 || i === 2 || i === 3 || i === 4 || i === 5 || i === 6 || i === 7 || i === 8 || i === 9 || i === 10){
return true;
}
int minimum(int a, int b, int c){
int mini =a*b*c;
int iterator=0;
int test[3];
test[0]=a;
test[1]=b;
test[2]=c;
for (iterator=0;iterator<3;iterator++){
if (test[iterator]<mini){
mini=test[iterator];
}
}
return mini;
}
I hope that your 3 numbers aren't larger than 1290!
if (string.Compare(json["result"].ToString(), "OK", true) == 0)
{
if (string.Compare(json["list"][0]["result"].ToString(), "OK", true) == 0)
return null;
//omitted
}
base.transform.name = this.bodyName;
this.radius = this.diameterKm * 500.0;
this.mass = Math.Pow(this.radius, 2.0) * this.surfaceGravity;
this.cameraSwitchHeightM = this.cameraSwitchHeightKm * 1000.0;
if (this.atmosphereData.shadowIntensity == 0f)
{
this.atmosphereData.shadowIntensity = 1.65f;
}
this.atmosphereData.atmosphereHeightM = this.atmosphereData.atmosphereHeightKm * 1000.0;
if (this.terrainData.terrainMaterial != null)
{
this.terrainData.terrainMaterial.color = this.terrainData.terrainColor;
}
this.terrainData.maxTerrainHeight = this.GetMaxTerrainHeight();
this.terrainData.unitToAngle = 360.0 / ((this.radius + this.terrainData.maxTerrainHeight) * 2.0 * 3.1415926535897931);
for (int i = 0; i < this.terrainData.detailLevels.Length; i++)
{
this.terrainData.detailLevels[i].chunckSize = (double)this.terrainData.baseChunckSize / Math.Pow(2.0, (double)i);
this.terrainData.detailLevels[i].angularSize = (float)this.terrainData.detailLevels[i].chunckSize / (float)this.terrainData.heightMaps[0].heightMap.HeightDataArray.Length * 360f;
}
this.terrainData.detailLevels[0].loadDistance = double.PositiveInfinity;
if (this.type == CelestialBodyData.Type.Star)
{
this.parentBody = null;
this.orbitData.SOIMultiplier = double.PositiveInfinity;
}
if (this.parentBody != null && (this.type == this.parentBody.type || (this.type == CelestialBodyData.Type.Planet && this.parentBody.type == CelestialBodyData.Type.Moon)))
{
this.parentBody = null;
}
if (this.parentBody != null)
{
this.orbitData._period = Kepler.GetPeriod(0.0, this.orbitData.orbitHeightM, this.parentBody.mass);
this.orbitData.periodString = Ref.GetTimeString(this.orbitData._period);
this.orbitData._meanMotion = -6.2831853071795862 / this.orbitData._period;
this.orbitData.orbitalVelocity = this.orbitData.orbitHeightM * this.orbitData._meanMotion;
this.orbitData.SOI = this.orbitData.orbitHeightM * Math.Pow(this.mass / this.parentBody.mass, 0.4) * this.orbitData.SOIMultiplier;
if (!this.ParentHasThisBodyAsSatellite())
{
List<CelestialBodyData> list = new List<CelestialBodyData>(this.parentBody.satellites);
list.Add(this);
this.parentBody.satellites = list.ToArray();
this.parentBody.ValidateSatellites();
}