control

I have problem about my program, this program used to control toy car

like R/C(radio control). like this little story :

we know about how drive R/C(radio control), if we push button move than car to move

if we push button move and push button move to left or right than car to

move and rotate left or right.

and I use computer to can drive car like we drive R/C(radio control) car

but I use the map before computer to khow where is destination and don't crash

my be you can see " picture 1 ". I use red color for car and blu color

for destination and the last black color for the map.

car move from left monitor to right monitor for initial position and then

car move to destination if in ahead car have barrier then car

rotate like " picture 1 ".

for note ' car can rotate left or right because he have sensor. this sensor

just check pixcel in ahead my be 35 long from car see " picture 3 " , this sensor

have 4 sensor on top, under, left , right monitor in the " picture 3 " I build 1 sensor '

the problem if I rotate car for initial position car move from right monitor

to left monitor he can move. car can move this position but for initial position

car move from left monitor the sensor error he can't check that ahead have barrier

you can see " picture 4 ". if I not used that program for initial position car move

from right monitor car move don't crash.

where is wrong ?

I done to all procedure to check

I can't find this error

( for help I give my full program )

{for picture you can email me : ba12yu@yahoo.co.uk

import java.awt.*;

import java.awt.event.*;

import java.io.*;

import java.io.InputStream;

import java.io.IOException;

import java.io.OutputStream;

import java.util.*;

import java.util.Enumeration;

import java.util.TooManyListenersException;

import java.applet.*;

import javax.comm.*;

//import java.lang.Thread;

/*<applet code = "control" height = 450 width =650>

</applet>*/

//klass control

public class control extends Applet implements ItemListener,ActionListener,MouseListener,MouseMotionListener {

// deklarasi variable

String kh,aj;

String msg="o";

Enumeration portList;

CommPortIdentifier portId;

SerialPort serialPort;

OutputStream outputStream;

CheckboxGroup h = new CheckboxGroup();

Checkbox mobil = new Checkbox("Tampil Mobil",h,false);

Checkbox target = new Checkbox("Tampil Target",h,false);

Checkbox tmp = new Checkbox("t",h,false);

Button jalan = new Button("Jalan");

Button ok = new Button("OK");

//button putar = new Button("Putar");

final int n = 1;

final int m = 6;

final int r = 5;

double kot[][] = new double[2][r];

int tkot[][] = new int[2][r];

double kub[][][] = new double[n][3][m];

int tkub[][][] = new int[n][2][m];

int px,py,sx,sy,dg,cj=0;

boolean tos;

int xx,yy,p,q,c,l,nm,tp,b5;

double v,b,rt,re;

int dep,bel,kir,kan;

double cv,cn,aa,bb,pstx,psty;

double xx1,yy1;

double wa,qo,u,x,y,z;

int y1,y2,l1,l2,l3,l4,dx,dy,dz,de2,ee1,de1,ee2;

int a1,a2,a3,a4,a5,a6,a7,a8;

int zx1,zx2,zx3,zx4,zx5,zx6,zx7,zx8;

int zy1,zy2,zy3,zy4;

int zk1,zk2,zk3,zk4;

int w=1,w1=1,w2=1,w3=1,w4=1,w5=1,w6=0,w7=0,w8=0,w9=0;

//deklarasi peta

int r1=127, r2=127, r3=63, r4=25;

int t1=355, t2=76, t3=25, t4=25;

int u1=298, u2=127, u3=63, u4=76;

int b1=507, b2=5,b3=38, b4=152;

int e1=279, e2=184, e3=279, e4=101;

int o1=89, o2=221, o3=177, o4=63;

int i1=5,i2=127, i3=63, i4=127;

int v1=152, v2=5,v3=89, v4=38;

// build box destination

public void kot() {

kot[0][0]=230;kot[1][0]=100;

kot[0][1]=240;kot[1][1]=100;

kot[0][2]=240;kot[1][2]=110;

kot[0][3]=230;kot[1][3]=110;

kot[0][4]=230;kot[1][4]=100;

tukar();

//pusat();

posisi1();

}

//build car

public void kotak(){

kub[0][0][0]=20;kub[0][1][0]=10; kub[0][2][0]=0;

kub[0][0][1]=-20; kub[0][1][1]=10; kub[0][2][1]=0;

kub[0][0][2]=-20; kub[0][1][2]=-10; kub[0][2][2]=0;

kub[0][0][3]=20;kub[0][1][3]=-10; kub[0][2][3]=0;

kub[0][0][4]=25;kub[0][1][4]=0; kub[0][2][4]=0;

kub[0][0][5]=20;kub[0][1][5]=10; kub[0][2][5]=0;

posisi();

salin();

//depan();

//kiri();

//kanan();

//belakang();

}

//

//build cek sensor pixcel

//

public void cek1(){

if(tkub[0][0][0]!=tkub[0][0][1] && tkub[0][0][0] > tkub[0][0][1]){

if(pstx!=v){

if(l1!=0 && w!=0){

//maju

jal();

hub1();

//mobil rotasi pada l1==0 ke kiri

if(l1==0 && l2!=0 && l3==0){

w=0;

hub1();

//for(int i=0;i<=500;i++){

// if(i!=500)

// msg="d";

//send(msg); }

rot(Math.PI/4);

if(cv!=zx2)

repaint(250);

hub1();

//mobil rotasi pada l1==0 ke kanan

}else if(l1==0 && l2==0 && l3!=0){

w=0;

hub1();

// for(int i=0;i<=500;i++){

// if(i!=500)

//msg="c";

//send(msg);}

rot1(Math.PI/4);

if(cv!=zx8)//a2 *zx6

repaint(250);

hub1();

}else if(l1==0 && l2!=0 && l3!=0){

w=0;

w1=0;

w2=0;

hub1();

if(cn > b){

// for(int i=0;i<=500;i++){

//if(i!=500)

//msg="c";

//send(msg);}

rot(Math.PI/2);

if(cv!=zk2)

repaint(250);

w7=1;

hub1();

}else if(tkub[0][1][3] < b){

//for(int i=0;i<=500;i++){

//if(i!=500)

// msg="c";

// send(msg);}

rot1(Math.PI/2);

if(cv!=zy2)

repaint(250);

w6=1;

hub1();}

}

}

//jalan miring kiri

}

if(l1!=0 && w==0 && w1!=0){

w=0;

//msg="a";

//send(msg);

trans(1,-1);

if(l1!=0 && w1!=0)

repaint(215);

hub1();

if(l1==0 && w1!=0){

w1=0;

// for(int i=0;i<=500;i++){

// if(i!=500)

// msg="c";

//send(msg);}

rot1(Math.PI/4);

if(cv!=zx7)//a1

repaint(250);

hub1();

//w2=0;

w=1;}

//jalan miring kanan

}else if(l1==0 && w==0 && w2!=0){

//msg="a";

//send(msg);

trans(1,1);

if(l1==0 && w2!=0)

repaint(215);

hub1();

w1=0;

if(l1!=0 && w2!=0){

w2=0;

//for(int i=0;i<=500;i++){

// if(i!=500)

//msg="b";

//send(msg);}

rot(Math.PI/4);

if(cv!=zx1);

repaint(250);

hub1();

w=1;}

}

//berheti jika target di depan

if(pstx==v){

if(cn<=b && tkub[0][1][3] >= b){

//msg="d";

//send(msg);

w=0;

w1=0;

w2=0;

hub1();

}

//untuk melakukan pengecekan jika tujuan diluar jangkauan

if(cn > b){

//for(int i=0;i<=500;i++){

// if(i!=500)

//msg="d";

//send(msg);}

rot(Math.PI/2);

if(cv!=zk2)//zk

repaint(250);

hub1();

w=0;

w1=0;

w2=0;

w7=1;

}else if(tkub[0][1][3] < b){

//for(int i=0;i<=500;i++){

//if(i!=500)

//msg="d";

//send(msg);}

rot1(Math.PI/2);

if(cv!=zx7) //zy2

repaint(250);

hub1();

w=0;

w1=0;

w2=0;

w6=1;}

}

}

// maju ke atas montor dalam peta

if(cn > b && w==0 && w7!=0){

trans(0,-1);

if(cn!=b)

repaint(215);

hub1();}

if(cn==b && tkub[0][0][3] < v){

rot1(Math.PI/2);

if(cv!=zx7)

repaint(250);

hub1();

w=1;

w1=0;

w2=0;

w7=0;}

// maju ke bawah monitor dalam peta

if(tkub[0][1][3] < b && w==0 && w6!=0){

trans(0,1);

if(cn!=b)

repaint(215);

hub1();}

if(cn==b && cv < v){

rot(Math.PI/2);

if(cv!=zk4)

repaint(250);

hub1();

w=1;

w1=0;

w2=0;

w6=0;}

}

//

//

//

public void jal(){ //for car to move

trans(1,0);

//msg="a";

//send(msg);

if(l1!=0 && w!=0)

repaint(215);}

//check car position

public void hub1(){

if(tkub[0][0][0]!=tkub[0][0][1] && tkub[0][0][0] > tkub[0][0][1]){

periksa1();

periksa2();

periksa3();

periksa4();

}else

if(tkub[0][0][0]!=tkub[0][0][1] && tkub[0][0][0] < tkub[0][0][1]){

periksa1b();

periksa2b();

periksa3b();

periksa4b();

}else

if(tkub[0][1][0]!=tkub[0][1][1] && tkub[0][1][0] > tkub[0][1][1]){

periksa1c();

periksa2c();

periksa3c();

periksa4c();

}else

if(tkub[0][1][0] != tkub[0][1][1] && tkub[0][1][0] < tkub[0][1][1]){

periksa1a();

periksa2a();

periksa3a();

periksa4a();

}

}

//for initial position left to right monitor

//check sensor pixcel

// ahead sensor

public void periksa1(){

if(dep >= 5 && dep <=5+557

&& de1 >= 5 && de1 <= 5+279){

if(dep >= r1 && dep <= r1+r3

&& de1 >= r2 && de1 <= r2+r4){

l1=0;

}else if(dep >= v1 && dep <=v1+v3

&& de1 >= v2 && de1 <=v2+v4){

l1=0;

}else if(dep >= u1 && dep<=u1+u3

&& de1 >= u2 && de1<=u2+u4){

l1=0;

}else if(dep >= t1 && dep<= t1+t3

&& de1 >= t2 && de1 <=t2+t4){

l1=0;

}else if(dep >= i1 && dep<=i1+i3

&& de1 >= i2 && de1 <=i2+i4){

l1=0;

}else if(dep >= o1 && dep<=o1+o3

&& de1 >= o2 && de1 <=o2+o4){

l1=0;

}else if(dep >= e1 && dep<= e1+e3

&& de1 >= e2 && de1 <=e2+e4){

l1=0;

}else if(dep >= b1 && dep <= b1+b3

&& de1 >= b2 && de1 <= b2+b4){

l1=0;

}else{

l1=1;}

}else{

l1=0;}

}

//left sensor

public void periksa2(){

if(ee1 >= 5 && ee1 <=5+557

&& kir >= 5 && kir <=5+279){

if(ee1 >= r1 && ee1<= r1+r3

&& kir >= r2 && kir <=r2+r4){

l2=0;

}else if(ee1 >= v1 && ee1<= v1+v3

&& kir >= v2 && kir <= v2+v4){

l2=0;

}else if(ee1 >= u1 && ee1<=u1+u3

&& kir >= u2 && kir <=u2+u4){

l2=0;

}else if(ee1>= t1 && ee1<=t1+t3

&& kir >= t2 && kir <=t2+t4){

l2=0;

}else if(ee1 >= i1 && ee1<=i1+i3

&& kir >= i2 && kir <=i2+i4){

l2=0;

}else if(ee1 >= o1 && ee1<= o1+o3

&& kir >= o2 && kir <=o2+o4){

l2=0;

}else if(ee1 >= e1 && ee1<=e1+e3

&& kir >= e2 && kir <=e2+e4){

l2=0;

}else if(ee1 >= b1 && ee1<= b1+b3

&& kir >= b2 && kir <= b2+b4){

l2=0;

}else {

l2 =1;}

}else{

l2=0;

}

}

//right sensor

public void periksa3(){

if(ee2 >= 5 && ee2 <=5+557

&& kan >= 5 && kan <=5+279){

if(ee2 >= r1 && ee2<= r1+r3

&& kan >= r2 && kan <=r2+r4){

l3 = 0;

}else if(ee2 >= v1 && ee2<= v1+v3

&& kan >= v2 && kan <= v2+v4){

l3=0;

}else if( ee2 >= u1 && ee2<= u1+u3

&& kan >= u2 && kan <= u2+u4){

l3=0;

}else if(ee2 >= t1 && ee2<= t1+t3

&& kan >= t2 && kan <= t2+t4){

l3=0;

}else if( ee2 >= i1 && ee2<=i1+i3

&& kan >= i2 && kan <=i2+i4){

l3=0;

}else if( ee2 >= o1 && ee2<= o1+o3

&& kan >= o2 && kan <=o2+o4){

l3=0;

}else if( ee2 >= e1 && ee2<= e1+e3

&& kan >= e2&& kan <= e2+e4){

l3=0;

}else if( ee2 >= b1 && ee2<=b1+b3

&& kan >= b2 && kan <= b2+b4){

l3=0;

}else {

l3 =1;}

}else{

l3=0;

}

}

//behind sensor

public void periksa4(){

if((bel >= 5)&&(bel <=(5+557))

&&(de2 >= 5)&&(de2 <=(5+279))){

if((bel >= r1)&&(bel<=(r1+r3))

&&(de2 >= r2)&&(de2 <=(r2+r4))){

l4=0;

}else if((bel >= v1)&&(bel<=(v1+v3))

&&(de2 >= v2)&&(de2 <=(v2+v4))){

l4=0;

}else if((bel >= u1)&&(bel<=(u1+u3))

&&(de2 >= u2)&&(de2 <=(u2+u4))){

l4=0;

}else if((bel >= t1)&&(bel<=(t1+t3))

&&(de2 >= t2)&&(de2 <=(t2+t4))){

l4=0;

}else if((bel >= i1)&&(bel<=(i1+i3))

&&(de2 >= i2)&&(de2 <=(i2+i4))){

l4=0;

}else if((bel >= o1)&&(bel<=(o1+o3))

&&(de2 >= o2)&&(de2 <=(o2+o4))){

l4=0;

}else if((bel >= e1)&&(bel<=(e1+e3))

&&(de2 >= e2)&&(de2 <=(e2+e4))){

l4=0;

}else if((bel >= b1)&&(bel<=(b1+b3))

&&(de2 >= b2)&&(de2 <=(b2+b4))){

l4=0;

}else if(l1==0 && l2==0 && l3==0){

l4 =1;

}else{

l4=0;}

}

}

//for next initial position

//

public void periksa1a(){

if((ee1 >= 5)&&(ee1 <=(5+557))

&&(dep >= 5)&&(dep <=(5+279))){

if((ee1 >= r1)&&(ee1<=(r1+r3))

&&(dep >= r2)&&(dep <=(r2+r4))){

l1=0;

}else if((ee1 >= v1)&&(ee1<=(v1+v3))

&&(dep >= v2)&&(dep <=(v2+v4))){

l1=0;

}else if((ee1 >= u1)&&(ee1<=(u1+u3))

&&(dep >= u2)&&(dep <=(u2+u4))){

l1=0;

}else if((ee1 >= t1)&&(ee1<=(t1+t3))

&&(dep >= t2)&&(dep <=(t2+t4))){

l1=0;

}else if((ee1 >= i1)&&(ee1<=(i1+i3))

&&(dep >= i2)&&(dep <=(i2+i4))){

l1=0;

}else if((ee1 >= o1)&&(ee1<=(o1+o3))

&&(dep >= o2)&&(dep <=(o2+o4))){

l1=0;

}else if((ee1>= e1)&&(ee1<=(e3))

&&(dep >= e2)&&(dep <=(e4))){

l1=0;

}else if((ee1 >= b1)&&(ee1<=(b1+b3))

&&(dep >= b2)&&(dep <=(b2+b4))){

l1=0;

}else {

l1 =1;}

}else{

l1=0;}

}

//

public void periksa2a(){

if((kir >= 5)&&(kir <=(5+557))

&&(de2 >= 5)&&(de2 <=(5+279))){

if((kir >= r1)&&(kir<=(r1+r3))

&&(de2 >= r2)&&(de2 <=(r2+r4))){

l2 = 0;

}else if((kir >= v1)&&(kir<=(v1+v3))

&&(de2 >= v2)&&(de2 <=(v2+v4))){

l2=0;

}else if((kir >= u1)&&(kir<=(u1+u3))

&&(de2 >= u2)&&(de2 <=(u2+u4))){

l2=0;

}else if((kir >= t1)&&(kir<=(t1+t3))

&&(de2 >= t2)&&(de2 <=(t2+t4))){

l2=0;

}else if((kir >= i1)&&(kir<=(i1+i3))

&&(de2 >= i2)&&(de2 <=(i2+i4))){

l2=0;

}else if((kir >= o1)&&(kir<=(o1+o3))

&&(de2 >= o2)&&(de2 <=(o2+o4))){

l2=0;

}else if((kir >= e1)&&(kir<=(e3))

&&(de2 >= e2)&&(de2 <=(e4))){

l2=0;

}else if((kir >= b1)&&(kir<=(b1+b3))

&&(de2 >= b2)&&(de2 <=(b2+b4))){

l2=0;

}else {

l2 =1;}

}else{

l2=0;}

}

//

public void periksa3a(){

if((kan>= 5)&&(kan <=(5+557))

&&(de1 >= 5)&&(de1 <=(5+279))){

if((kan >= r1)&&(kan<=(r1+r3))

&&(de1 >= r2)&&(de1 <=(r2+r4))){

l3 = 0;

}else if((kan >= v1)&&(kan<=(v1+v3))

&&(de1 >= v2)&&(de1 <=(v2+v4))){

l3=0;

}else if((kan >= u1)&&(kan<=(u1+u3))

&&(de1 >= u2)&&(de1 <=(u2+u4))){

l3=0;

}else if((kan >= t1)&&(kan<=(t1+t3))

&&(de1 >= t2)&&(de1 <=(t2+t4))){

l3=0;

}else if((kan >= i1)&&(kan<=(i1+i3))

&&(de1 >= i2)&&(de1 <=(i2+i4))){

l3=0;

}else if((kan >= o1)&&(kan<=(o1+o3))

&&(de1 >= o2)&&(de1 <=(o2+o4))){

l3=0;

}else if((kan >= e1)&&(kan<=(e3))

&&(de1 >= e2)&&(de1 <=(e4))){

l3=0;

}else if((kan >= b1)&&(kan<=(b1+b3))

&&(de1 >= b2)&&(de1 <=(b2+b4))){

l3=0;

}else{

l3 =1;}

}else{

l3=0;}

}

//

public void periksa4a(){

if((ee2 >= 5)&&(ee2 <=(5+557))

&&(bel >= 5)&&(bel <=(5+279))){

if((ee2 >= r1)&&(ee2<=(r1+r3))

&&(bel >= r2)&&(bel <=(r2+r4))){

l4 = 0;

}else if((ee2 >= v1)&&(ee2<=(v1+v3))

&&(bel >= v2)&&(bel <=(v2+v4))){

l4=0;

}else if((ee2 >= u1)&&(ee2<=(u1+u3))

&&(bel >= u2)&&(bel <=(u2+u4))){

l4=0;

}else if((ee2 >= t1)&&(ee2<=(t1+t3))

&&(bel >= t2)&&(bel <=(t2+t4))){

l4=0;

}else if((ee2>= i1)&&(ee2<=(i1+i3))

&&(bel >= i2)&&(bel <=(i2+i4))){

l4=0;

}else if((ee2 >= o1)&&(ee2<=(o1+o3))

&&(bel >= o2)&&(bel <=(o2+o4))){

l4=0;

}else if((ee2 >= e1)&&(ee2<=(e3))

&&(bel >= e2)&&(bel<=(e4))){

l4=0;

}else if((ee2 >= b1)&&(ee2<=(b1+b3))

&&(bel >= b2)&&(bel <=(b2+b4))){

l4=0;

}else if((l1==0)&&(l2==0)&&(l3==0)){

l4 =1;

}else{

l4=0;}

}

}

public void periksa1b(){

if(dep >= 5 && dep <=5+557

&& de2 >= 5 && de2 <= 5+279){

if(dep >= r1 && dep<= r1+r3

&& de2 >= r2 && de2 <= r2+r4){

l1=0;

}else if(dep >= v1 && dep<=v1+v3

&& de2 >= v2 && de2<=v2+v4){

l1=0;

}else if(dep >= u1 && dep<=u1+u3

&& de2 >= u2 && de2<=u2+u4){

l1=0;

}else if(dep >= t1 && dep<= t1+t3

&& de2 >= t2 && de2 <=t2+t4){

l1=0;

}else if(dep >= i1 && dep<=i1+i3

&& de2 >= i2 && de2 <=i2+i4){

l1=0;

}else if(dep >= o1 && dep<=o1+o3

&& de2 >= o2 && de2 <=o2+o4){

l1=0;

}else if(dep >= e1 && dep<= e1+e3

&& de2 >= e2 && de2 <=e2+e4){

l1=0;

}else if(dep >= b1 && dep <= b1+b3

&& de2 >= b2 && de2 <= b2+b4){

l1=0;

}else{

l1=1;}

}else{

l1=0;}

}

public void periksa2b(){

if((ee2 >= 5)&&(ee2 <=(5+557))

&&(kir >= 5)&&(kir <=(5+279))){

if((ee2 >= r1)&&(ee2<=(r1+r3))

&&(kir >= r2)&&(kir <=(r2+r4))){

l2=0;

}else if((ee2 >= v1)&&(ee2<=(v1+v3))

&&(kir >= v2)&&(kir <=(v2+v4))){

l2=0;

}else if((ee2 >= u1)&&(ee2<=(u1+u3))

&&(kir >= u2)&&(kir <=(u2+u4))){

l2=0;

}else if((ee2>= t1)&&(ee2<=(t1+t3))

&&(kir >= t2)&&(kir <=(t2+t4))){

l2=0;

}else if((ee2 >= i1)&&(ee2<=(i1+i3))

&&(kir >= i2)&&(kir <=(i2+i4))){

l2=0;

}else if((ee2 >= o1)&&(ee2<=(o1+o3))

&&(kir >= o2)&&(kir <=(o2+o4))){

l2=0;

}else if((ee2 >= e1)&&(ee2<=(e1+e3))

&&(kir >= e2)&&(kir <=(e2+e4))){

l2=0;

}else if((ee2 >= b1)&&(ee2<=(b1+b3))

&&(kir >= b2)&&(kir <=(b2+b4))){

l2=0;

}else {

l2 =1;}

}else{

l2=0;

}

}

public void periksa3b(){

if((ee1 >= 5)&&(ee1 <=(5+557))

&&(kan >= 5)&&(kan <=(5+279))){

if((ee1 >= r1)&&(ee1<=(r1+r3))

&&(kan >= r2)&&(kan <=(r2+r4))){

l3 = 0;

}else if((ee1 >= v1)&&(ee1<=(v1+v3))

&&(kan >= v2)&&(kan <=(v2+v4))){

l3=0;

}else if((ee1 >= u1)&&(ee1<=(u1+u3))

&&(kan >= u2)&&(kan <=(u2+u4))){

l3=0;

}else if((ee1 >= t1)&&(ee1<=(t1+t3))

&&(kan >= t2)&&(kan <=(t2+t4))){

l3=0;

}else if((ee1 >= i1)&&(ee1<=(i1+i3))

&&(kan >= i2)&&(kan <=(i2+i4))){

l3=0;

}else if((ee1 >= o1)&&(ee1<=(o1+o3))

&&(kan >= o2)&&(kan <=(o2+o4))){

l3=0;

}else if((ee1 >= e1)&&(ee1<=(e1+e3))

&&(kan >= e2)&&(kan <=(e2+e4))){

l3=0;

}else if((ee1 >= b1)&&(ee1<=(b1+b3))

&&(kan >= b2)&&(kan <=(b2+b4))){

l3=0;

}else {

l3 =1;}

}else{

l3=0;

}

}

public void periksa4b(){

if((bel >= 5)&&(bel <=(5+557))

&&(de1 >= 5)&&(de1 <=(5+279))){

if((bel >= r1)&&(bel<=(r1+r3))

&&(de1 >= r2)&&(de1 <=(r2+r4))){

l4=0;

}else if((bel >= v1)&&(bel<=(v1+v3))

&&(de1 >= v2)&&(de1 <=(v2+v4))){

l4=0;

}else if((bel >= u1)&&(bel<=(u1+u3))

&&(de1 >= u2)&&(de1 <=(u2+u4))){

l4=0;

}else if((bel >= t1)&&(bel<=(t1+t3))

&&(de1 >= t2)&&(de1 <=(t2+t4))){

l4=0;

}else if((bel >= i1)&&(bel<=(i1+i3))

&&(de1 >= i2)&&(de1 <=(i2+i4))){

l4=0;

}else if((bel >= o1)&&(bel<=(o1+o3))

&&(de1 >= o2)&&(de1 <=(o2+o4))){

l4=0;

}else if((bel >= e1)&&(bel<=(e1+e3))

&&(de1 >= e2)&&(de1 <=(e2+e4))){

l4=0;

}else if((bel >= b1)&&(bel<=(b1+b3))

&&(de1 >= b2)&&(de1 <=(b2+b4))){

l4=0;

}else if(l1==0 && l2==0 && l3==0){

l4 =1;

}else{

l4=0;}

}

}

public void periksa1c(){

if((ee2 >= 5)&&(ee2 <=(5+557))

&&(dep >= 5)&&(dep <=(5+279))){

if((ee2 >= r1)&&(ee2<=(r1+r3))

&&(dep >= r2)&&(dep <=(r2+r4))){

l1=0;

}else if((ee2 >= v1)&&(ee2<=(v1+v3))

&&(dep >= v2)&&(dep <=(v2+v4))){

l1=0;

}else if((ee2 >= u1)&&(ee2<=(u1+u3))

&&(dep >= u2)&&(dep <=(u2+u4))){

l1=0;

}else if((ee2 >= t1)&&(ee2<=(t1+t3))

&&(dep >= t2)&&(dep <=(t2+t4))){

l1=0;

}else if((ee2 >= i1)&&(ee2<=(i1+i3))

&&(dep >= i2)&&(dep <=(i2+i4))){

l1=0;

}else if((ee2 >= o1)&&(ee2<=(o1+o3))

&&(dep >= o2)&&(dep <=(o2+o4))){

l1=0;

}else if((ee2>= e1)&&(ee2<=(e3))

&&(dep >= e2)&&(dep <=(e4))){

l1=0;

}else if((ee2 >= b1)&&(ee2<=(b1+b3))

&&(dep >= b2)&&(dep <=(b2+b4))){

l1=0;

}else {

l1 =1;}

}else{

l1=0;}

}

public void periksa2c(){

if((kir >= 5)&&(kir <=(5+557))

&&(de1 >= 5)&&(de1 <=(5+279))){

if((kir >= r1)&&(kir<=(r1+r3))

&&(de1 >= r2)&&(de1 <=(r2+r4))){

l2 = 0;

}else if((kir >= v1)&&(kir<=(v1+v3))

&&(de1 >= v2)&&(de1 <=(v2+v4))){

l2=0;

}else if((kir >= u1)&&(kir<=(u1+u3))

&&(de1 >= u2)&&(de1 <=(u2+u4))){

l2=0;

}else if((kir >= t1)&&(kir<=(t1+t3))

&&(de1 >= t2)&&(de1 <=(t2+t4))){

l2=0;

}else if((kir >= i1)&&(kir<=(i1+i3))

&&(de1 >= i2)&&(de1 <=(i2+i4))){

l2=0;

}else if((kir >= o1)&&(kir<=(o1+o3))

&&(de1 >= o2)&&(de1 <=(o2+o4))){

l2=0;

}else if((kir >= e1)&&(kir<=(e3))

&&(de1 >= e2)&&(de1 <=(e4))){

l2=0;

}else if((kir >= b1)&&(kir<=(b1+b3))

&&(de1 >= b2)&&(de1 <=(b2+b4))){

l2=0;

}else {

l2 =1;}

}else{

l2=0;}

}

public void periksa3c(){

if((kan>= 5)&&(kan <=(5+557))

&&(de2 >= 5)&&(de2 <=(5+279))){

if((kan >= r1)&&(kan<=(r1+r3))

&&(de2 >= r2)&&(de2 <=(r2+r4))){

l3 = 0;

}else if((kan >= v1)&&(kan<=(v1+v3))

&&(de2 >= v2)&&(de2 <=(v2+v4))){

l3=0;

}else if((kan >= u1)&&(kan<=(u1+u3))

&&(de2 >= u2)&&(de2 <=(u2+u4))){

l3=0;

}else if((kan >= t1)&&(kan<=(t1+t3))

&&(de2 >= t2)&&(de2 <=(t2+t4))){

l3=0;

}else if((kan >= i1)&&(kan<=(i1+i3))

&&(de2 >= i2)&&(de2 <=(i2+i4))){

l3=0;

}else if((kan >= o1)&&(kan<=(o1+o3))

&&(de2 >= o2)&&(de2 <=(o2+o4))){

l3=0;

}else if((kan >= e1)&&(kan<=(e3))

&&(de2 >= e2)&&(de2 <=(e4))){

l3=0;

}else if((kan >= b1)&&(kan<=(b1+b3))

&&(de2 >= b2)&&(de2 <=(b2+b4))){

l3=0;

}else{

l3 =1;}

}else{

l3=0;}

}

public void periksa4c(){

if((ee1 >= 5)&&(ee1 <=(5+557))

&&(bel >= 5)&&(bel <=(5+279))){

if((ee1 >= r1)&&(ee1<=(r1+r3))

&&(bel >= r2)&&(bel <=(r2+r4))){

l4 = 0;

}else if((ee1 >= v1)&&(ee1<=(v1+v3))

&&(bel >= v2)&&(bel <=(v2+v4))){

l4=0;

}else if((ee1 >= u1)&&(ee1<=(u1+u3))

&&(bel >= u2)&&(bel <=(u2+u4))){

l4=0;

}else if((ee1 >= t1)&&(ee1<=(t1+t3))

&&(bel >= t2)&&(bel <=(t2+t4))){

l4=0;

}else if((ee1>= i1)&&(ee1<=(i1+i3))

&&(bel >= i2)&&(bel <=(i2+i4))){

l4=0;

}else if((ee1 >= o1)&&(ee1<=(o1+o3))

&&(bel >= o2)&&(bel <=(o2+o4))){

l4=0;

}else if((ee1 >= e1)&&(ee1<=(e3))

&&(bel >= e2)&&(bel<=(e4))){

l4=0;

}else if((ee1 >= b1)&&(ee1<=(b1+b3))

&&(bel >= b2)&&(bel <=(b2+b4))){

l4=0;

}else if((l1==0)&&(l2==0)&&(l3==0)){

l4 =1;

}else{

l4=0;}

}

}

//convert car position

//

//public void posisi(){

if((xx < 20) || (xx > 20)){

p = xx - 20;

cob1();

cob2();

cob3();

cob4();

}

if((yy < 10)||(yy > 10)){

q =yy + 10;}

}

//convert destination position

public void posisi1(){

if((xx < 230) || (xx > 230)){

c = xx - 230;}

if((yy < 100)||(yy > 100)){

l = yy + 100; }

}

//in inisial position left to right monitor

//long sensor ahead pixcel

public void depan(){

de1 = (tkub[0][1][1]+tkub[0][1][2])/2;

for(int i=tkub[0][0][0];i<=(tkub[0][0][0]+35);i+=1){

for(int j=de1; j<=de1; j++){

dep = i;

}

}

}

//long sensor left pixcel

public void kiri(){

ee1 = (tkub[0][0][0]+tkub[0][0][1])/2;

for(int i=ee1;i<=ee1;i+=1){

for(int j=tkub[0][1][0];j>=(tkub[0][1][0]-35);j--){

kir = j;

}

}

}

//long sensor right pixcel

public void kanan(){

ee2 = (tkub[0][0][0]+tkub[0][0][1])/2;

for(int i=ee2;i<=ee2;i+=1){

for(int j=tkub[0][1][3];j<=(tkub[0][1][3]+35);j++){

kan = j;

}

}

}

//long sensor behind pixcel

public void belakang(){

de2 = (tkub[0][1][1]+tkub[0][1][2])/2;

for(int i=tkub[0][0][1];i>=(tkub[0][0][1]-35);i--){

for(int j=de2;j<=de2;j++){

bel = i;

}

}

}

// next inisial position

public void depan1(){

ee1 = (tkub[0][0][1]+tkub[0][0][2])/2;

for(int i=ee1;i<=ee1;i+=1){

for(int j=tkub[0][1][0];j>=(tkub[0][1][0]-35);j--){

dep = j;

}

}

}

public void kiri1(){

de2 = (tkub[0][1][0]+tkub[0][1][1])/2;

for(int i=tkub[0][0][1];i>=(tkub[0][0][1]-35);i--){

for(int j=de2;j<=de2;j++){

kir = i;

}

}

}

public void kanan1(){

de1 = (tkub[0][1][0]+tkub[0][1][1])/2;

for(int i=tkub[0][0][3];i<=(tkub[0][0][3]+35);i+=1){

for(int j=de1;j<=de1;j+=1){

kan = i;

}

}

}

public void belakang1(){

ee2 = (tkub[0][0][1]+tkub[0][0][2])/2;

for(int i=ee2;i<=ee2;i+=1){

for(int j=tkub[0][1][1];j<=(tkub[0][1][1]+35);j++){

bel = j;

}

}

}

public void depan2(){

de2 = (tkub[0][1][1]+tkub[0][1][2])/2;

for(int i=tkub[0][0][0];i>=(tkub[0][0][0]-35);i--){

for(int j=de2;j<=de2;j++){

kan = i;

}

}

}

public void kiri2(){

ee2 = (tkub[0][0][0]+tkub[0][0][1])/2;

for(int i=ee2;i<=ee2;i++){

for(int j=tkub[0][1][0];j<=(tkub[0][1][0]+35);j++){

kir = j;

}

}

}

public void kanan2(){

ee1 = (tkub[0][0][0]+tkub[0][0][1])/2;

for(int i=ee1;i<=ee1;i++){

for(int j=tkub[0][1][3];j>=(tkub[0][1][3]-35);j--){

kan = j;

}

}

}

public void belakang2(){

de1 = (tkub[0][1][1]+tkub[0][1][2])/2;

for(int i=tkub[0][0][1];i<=(tkub[0][0][1]+35);i++){

for(int j=de1;j<=de1;j++){

bel = i;

}

}

}

public void depan3(){

ee2 = (tkub[0][0][1]+tkub[0][0][2])/2;

for(int i=ee2;i<=ee2;i+=1){

for(int j=tkub[0][1][0];j<=(tkub[0][1][0]+35);j++){

dep = j;

}

}

}

public void kiri3(){

de1 = (tkub[0][1][0]+tkub[0][1][1])/2;

for(int i=tkub[0][0][0];i<=(tkub[0][0][0]+35);i+=1){

for(int j=de1;j<=de1;j+=1){

kir = i;

}

}

}

public void kanan3(){

int de2 = (tkub[0][1][0]+tkub[0][1][1])/2;

for(int i=tkub[0][0][3];i>=(tkub[0][0][3]-35);i--){

for(int j=de2;j<=de2;j++){

kan = i;

}

}

}

public void belakang3(){

ee1 = (tkub[0][0][1]+tkub[0][0][2])/2;

for(int i=ee1;i<=ee1;i+=1){

for(int j=tkub[0][1][1];j>=(tkub[0][1][1]-35);j--){

bel = j;

}

}

}

//show picture destination

public void tukar(){

for(int i=0;i<r;i+=1){

tkot[0] = c+(int)kot[0];

tkot[1] = l-(int)kot[1];

}

pusat();

}

//show picture car

public void salin(){

for(int i=0;i<n;i+=1)

for(int j=0;j<m;j+=1){

tkub[0][j] = p+(int)kub[0][j]+(int)kub[2][j];

tkub[1][j] = q-(int)kub[1][j]+(int)kub[2][j];

}

ambil();

pusat1();

pst();

}

//for all position sensor pixcel

public void ambil(){

if(tkub[0][1][0] != tkub[0][1][1] && tkub[0][1][0] >< tkub[0][1][1]){

depan1();

kiri1();

kanan1();

belakang1();

}else

if(tkub[0][0][0]!=tkub[0][0][1] && tkub[0][0][0] > tkub[0][0][1]){

depan();

kiri();

kanan();

belakang();

}else

if(tkub[0][1][0]!=tkub[0][1][1] && tkub[0][1][0] > tkub[0][1][1]){

depan3();

kiri3();

kanan3();

belakang3();

}else

if(tkub[0][0][0]!=tkub[0][0][1] && tkub[0][0][0] < tkub[0][0][1]){

depan2();

kiri2();

kanan2();

belakang2();

}

}

//dot main for destination

public void pusat(){

v = tkot[0][0];

b = tkot[1][0];

}

//dot main for car

public void pusat1(){

cv = tkub[0][0][0];

cn = tkub[0][1][0];

}

//dot main for car too

public void pst(){

pstx = (tkub[0][0][0]+tkub[0][0][1])/2;

psty = (tkub[0][1][1]+tkub[0][1][2])/2;

}

//translation for car

public void trans(int f,int h){

/*for(int i=0;i<n;i+=1)

{for(int j=0;j<m;j+=1)

{

kub[0][j] += f;

kub[1][j] += h;

}

}*/

p =p+f;

q =q+h;

salin();

hub1();

}

//rotare car clock direction

public void rot(double d){

for(int i=0;i<n;i++)

{for(int j=0;j<m;j++)

{x = kub[0][j] * Math.cos(d) - kub[1][j] * Math.sin(d);

y = kub[0][j] * Math.sin(d) + kub[1][j] * Math.cos(d);

z = kub[2][j];

kub[0][j]=x; kub[1][j]=y; kub[2][j] = z;

}

}

salin();

}

// rotate car clock return

public void rot1(double a){

for(int i=0;i<n;i++)

{for(int j=0;j<m;j++)

{wa = kub[0][j] * Math.cos(a) + kub[1][j] * Math.sin(a);

qo = (-kub[0][j]) * Math.sin(a) + kub[1][j] * Math.cos(a);

u = kub[2][j];

kub[0][j]=wa; kub[1][j]=qo; kub[2][j] = u;

}

}

salin();

}

//build show

public void buat(){

setLayout(null);

mobil.setBounds(63,385,100,15);

target.setBounds(167,385,100,15);

ok.setBounds(267,383,63,20);

//putar.setBounds(328,383,63,20);

jalan.setBounds(480,383,63,20);

tmp.setBounds(167,400,100,15);

}

//show

public void tam(){

add(mobil);

add(target);

add(ok);

add(jalan);

//add(putar);

add(tmp);

}

//

public void init(){

setBackground(Color.white);

buat();

tam();

tos=false;

addMouseListener(this);

addMouseMotionListener(this);

tmp.setVisible(false);

}

//show map

public void map(Graphics2D g){

for(int i=0;i<n;i+=1){

g.setColor(Color.red);

g.fillPolygon(tkub[0],tkub[1],m);

}

}

//rotate half step

public void cob1(){

zx1=87;

zx2=70;

zx3=59;

zx4=60;

zx5=73;

zx6=90;

zx7=101;

zx8=100;

if(p><80){

b5 = 80 - p;

zx1 = zx1 - b5;

zx2 = zx2 - b5;

zx3 = zx3 - b5;

zx4 = zx4 - b5;

zx5 = zx5 - b5;

zx6 = zx6 - b5;

zx7 = zx7 - b5;

zx8 = zx8 - b5;

}else if(p>80){

b5 = p - 80;

zx1 = zx1 + b5;

zx2 = zx2 + b5;

zx3 = zx3 + b5;

zx4 = zx4 + b5;

zx5 = zx5 + b5;

zx6 = zx6 + b5;

zx7 = zx7 + b5;

zx8 = zx8 + b5;

}

}

public void cob2(){

a1=101;

a2=90;

a3=73;

a4=61;

a5=59;

a6=70;

a7=80;

a8=99;

if(p<80){

b5 = 80 - p;

a1 = a1 - b5;

a2 = a2 - b5;

a3 = a3 - b5;

a4 = a4 - b5;

a5 = a5 - b5;

a6 = a6 - b5;

a7 = a7 - b5;

a8 = a8 - b5;

}else if(p>80){

b5 = p - 80;

a1 = a1 + b5;

a2 = a2 + b5;

a3 = a3 + b5;

a4 = a4 + b5;

a5 = a5 + b5;

a6 = a6 + b5;

a7 = a7 + b5;

a8 = a8 + b5;

}

}

//rotate full step

public void cob3(){

zy1=71;

zy2=60;

zy3=89;

zy4=100;

if(p<80){

b5 = 80 - p;

zy1 = zy1 - b5;

zy2 = zy2 - b5;

zy3 = zy3 - b5;

zy4 = zy4 - b5;

}else if(p>80){

b5 = p - 80;

zy1 = zy1 + b5;

zy2 = zy2 + b5;

zy3 = zy3 + b5;

zy4 = zy4 + b5;

}

}

public void cob4(){

zk1=90;

zk2=60;

zk3=70;

zk4=100;

if(p<80){

b5 = 80 - p;

zk1 = zk1 - b5;

zk2 = zk2 - b5;

zk3 = zk3 - b5;

zk4 = zk4 - b5;

}else if(p>80){

b5 = p - 80;

zk1 = zk1 + b5;

zk2 = zk2 + b5;

zk3 = zk3 + b5;

zk4 = zk4 + b5;

}

}

//show graph

public void paint(Graphics s){

Graphics2D g = (Graphics2D) s;

map(g);

cek1();

s.setColor(Color.black);

s.fillRect(r1,r2,r3,t4);//mejautama

s.fillRect(t1,t2,t3,t4);//bangku

s.fillRect(u1,u2,u3,u4);//kursi3

s.fillRect(b1,b2,b3,b4);//meja2

s.fillRect(e1,e2,e3,e4);//meja

s.fillRect(o1,o2,o3,o4);//kursi2

s.fillRect(i1,i2,i3,i4);//kursi 1

s.fillRect(v1,v2,v3,v4);// aquarium

s.drawRect(5,5,557,279);// x = 12 pixel y = 12 pixel

s.setColor(Color.blue);

s.fillPolygon(tkot[0],tkot[1],r);

s.drawRect(50,365,510,50);

mobil.addItemListener(this);

target.addItemListener(this);

ok.addActionListener(this);

jalan.addActionListener(this);

//putar.addActionListener(this);

tmp.addItemListener(this);

}

//radio button

public void itemStateChanged(ItemEvent qw){

if(tos){

if(aj.equals("Tampil Target")){

kot();

}

if(aj.equals("Tampil Mobil")){

kotak();

}

}

repaint();

}

//mouse function

public void mouseMoved(MouseEvent ex) {

showStatus("posisi " + ex.getX() + "," + ex.getY()+ " " + dep+" "+kir+" "+kan+" "+bel+""+l1+l2+l3+l4);

}

public void mousePressed(MouseEvent ez) {

xx=ez.getX();

yy=ez.getY();

aj = h.getSelectedCheckbox().getLabel();

if(aj.equals("Tampil Target")) {

kot();

tos = true;

repaint();

}else if(aj.equals("Tampil Mobil")) {

kotak();

tos = true;

repaint();

}

}

public void mouseReleased(MouseEvent e) {

tos=false;

}

public void mouseEntered(MouseEvent ea) {}

public void mouseClicked(MouseEvent es) {}

public void mouseExited(MouseEvent ee) {}

public void mouseDragged(MouseEvent eq){}

//aktif button

public void actionPerformed(ActionEvent io){

kh = io.getActionCommand();

aj = h.getSelectedCheckbox().getLabel();

if(kh.equals("OK")){

mobil.getState();

mobil.setEnabled(false);

target.getState();

target.setEnabled(false);

tmp.setState(true);

//putar.setEnabled(false);

/*}else

if(kh.equals("Putar")){

rot(Math.PI/2);*/

}else

if(kh.equals("Jalan")){

hub1();

}

repaint();

}

/*public control(){

portList = CommPortIdentifier.getPortIdentifiers();

while (portList.hasMoreElements()) {

portId = (CommPortIdentifier) portList.nextElement();

if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {

if (portId.getName().equals("COM2")) {

try {

serialPort = (SerialPort)portId.open("controlApp", 3000);

} catch (PortInUseException ef){}

}

}

}

try {

outputStream = serialPort.getOutputStream();

} catch (IOException el){

if(serialPort!=null)

serialPort.close();

}

try {

serialPort.setSerialPortParams(9600,

SerialPort.DATABITS_8,

SerialPort.STOPBITS_1,

SerialPort.PARITY_NONE);

serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);

} catch (UnsupportedCommOperationException es){

if(serialPort != null)

serialPort.close();

}

send(msg);

}

public void send(String msg){

String msg1=msg;

try {

outputStream.write(msg1.getBytes());

//outputStream.flush();

}catch (IOException em) {}

}*/

//program utama

public static void main (String args[]){

Frame f = new Frame("KONTROL MOBIL");

control co = new control();

f.resize(650,450);

f.add("Center",co);

f.show();

co.init();

}

}

[42975 byte] By [kuyaa] at [2007-10-2 8:41:17]
# 1
So sorry, I do not drive compact cars!Maybe this thread will help[url] http://forum.java.sun.com/thread.jspa?threadID=695272[/url]kind regardswalken
walken16a at 2007-7-16 22:43:17 > top of Java-index,Java Essentials,Java Programming...
# 2
I think maybe you should use code tags.... It will be a little nicer to read.... just a thought
deanat78a at 2007-7-16 22:43:17 > top of Java-index,Java Essentials,Java Programming...
# 3
don't about compact cars but coodinate does not work
kuyaa at 2007-7-16 22:43:17 > top of Java-index,Java Essentials,Java Programming...
# 4

> I think maybe you should use code tags.... It will be

> a little nicer to read.... just a thought

This raises the question: if someone dumps a bunch of code in here,

without using [code] ... [/code] tags, what would the probability be

that the post does *not* end in italics? As a corollary: what would the

probability be that the post does *not* end in boldface? ;-)

kind regards,

Jos

JosAHa at 2007-7-16 22:43:17 > top of Java-index,Java Essentials,Java Programming...
# 5

> This raises the question: if someone dumps a bunch of

> code in here,

> without using [code] ... [/code] tags, what

> would the probability be

> that the post does *not* end in italics? As a

> corollary: what would the

> probability be that the post does *not* end in

> boldface? ;-)

>

The same probabilty that the coder does not use 'i' as an index! For the average code dropped here this is close to zero.

sabre150a at 2007-7-16 22:43:17 > top of Java-index,Java Essentials,Java Programming...
# 6
> The same probabilty that the coder does not use 'i'> as an index! For the average code dropped here this> is close to zero.For my code it's probability 1.
jverda at 2007-7-16 22:43:17 > top of Java-index,Java Essentials,Java Programming...
# 7

> > The same probabilty that the coder does not use

> 'i'

> > as an index! For the average code dropped here

> this

> > is close to zero.

>

> For my code it's probability 1.

:-) I am going to go though all your posts to see if this is true!

sabre150a at 2007-7-16 22:43:17 > top of Java-index,Java Essentials,Java Programming...
# 8
> > For my code it's probability 1.> > :-) I am going to go though all your posts to see if> this is true!23,401 left to do!
sabre150a at 2007-7-16 22:43:17 > top of Java-index,Java Essentials,Java Programming...
# 9

> > The same probabilty that the coder does not use 'i'

> > as an index! For the average code dropped here this

> > is close to zero.

>

> For my code it's probability 1.

Oh man, I hope you're not trying to tell us that you're one of those quiche

eating sissies that put spaces around their index names like [ i ]?

Or don't you use the mother of all index names at all?

kind regards,

Jos

ps ;-)

JosAHa at 2007-7-16 22:43:17 > top of Java-index,Java Essentials,Java Programming...
# 10

> Oh man, I hope you're not trying to tell us that

> you're one of those quiche

> eating sissies that put spaces around their index

> names like [ i ]?

> Or don't you use the mother of all index names at

> all?

Except in shell scripts, I don't use single-letter variable names. My loop indices are ix, jx, kx. Makes for easier search/replace. Or at least, it did when I got into the habit before I had (or maybe just before I learned how to use) regex search.

jverda at 2007-7-16 22:43:17 > top of Java-index,Java Essentials,Java Programming...
# 11
> > > For my code it's probability 1.> > > > :-) I am going to go though all your posts to see> if> > this is true!> > 23,401 left to do!23,377 left to do!
sabre150a at 2007-7-16 22:43:17 > top of Java-index,Java Essentials,Java Programming...
# 12

> > > > For my code it's probability 1.

> > >

> > > :-) I am going to go though all your posts to

> see

> > if

> > > this is true!

> >

> > 23,401 left to do!

>

> 23,377 left to do!

Some people clearly have too much time on their hands.

jverda at 2007-7-16 22:43:17 > top of Java-index,Java Essentials,Java Programming...
# 13

> > > > > For my code it's probability 1.

> > > >

> > > > :-) I am going to go though all your posts to see if this is true!

> > >

> > > 23,401 left to do!

> >

> > 23,377 left to do!

>

> Some people clearly have too much time on their hands.

Now hush; don't disturb Sabre; he's got important work to do!

kind regards,

Jos

ps ;-)

JosAHa at 2007-7-16 22:43:17 > top of Java-index,Java Essentials,Java Programming...
# 14

> > > > > > For my code it's probability 1.

> > > > >

> > > > > :-) I am going to go though all your posts to

> see if this is true!

> > > >

> > > > 23,401 left to do!

> > >

> > > 23,377 left to do!

> >

> > Some people clearly have too much time on their

> hands.

>

> Now hush; don't disturb Sabre; he's got important

> work to do!

Maybe I can distract him and make him start all over.

BANG! CRASH! I'M HENRY THE EIGHTH I AM, HENRY THE EIGHTH I AM I AM! WHOA DOC, YOU GOT THE WHOLE FIST UP THERE NOW? ZIPITTY DOO DA ZIPPITY AY, MY OH MY WHAT A WONDERFUL DAY! YEEEEEEEHAAAAWWWW!!!!

Aw, drat, I should've waited until he was down to about 8.

jverda at 2007-7-16 22:43:17 > top of Java-index,Java Essentials,Java Programming...
# 15

> > > > > > > For my code it's probability 1.

> > > > > >

> > > > > > :-) I am going to go though all your posts to see if this is true!

> > > > >

> > > > > 23,401 left to do!

> > > >

> > > > 23,377 left to do!

> > >

> > > Some people clearly have too much time on their hands.

> >

> > Now hush; don't disturb Sabre; he's got important work to do!

>

> Maybe I can distract him and make him start all over.

>

> BANG! CRASH! I'M HENRY THE EIGHTH I AM, HENRY THE

> EIGHTH I AM I AM! WHOA DOC, YOU GOT THE WHOLE FIST UP

> THERE NOW? ZIPITTY DOO DA ZIPPITY AY, MY OH MY WHAT A

> WONDERFUL DAY! YEEEEEEEHAAAAWWWW!!!!

You are not Henry the Eigth, because that's me; you are Napoleon XIV.

> Aw, drat, I should've waited until he was down to about 8.

He's so brave Sir Sabre!

He does all the labour!

kind regards,

Jos ;-)

JosAHa at 2007-7-20 19:49:53 > top of Java-index,Java Essentials,Java Programming...
# 16

> > > > For my code it's probability 1.

> > >

> > > :-) I am going to go though all your posts to

> see

> > if

> > > this is true!

> >

> > 23,401 left to do!

>

> 23,377 left to do!

7,212 left to do! Nearly there!

sabre150a at 2007-7-20 19:49:53 > top of Java-index,Java Essentials,Java Programming...
# 17

> > > > > For my code it's probability 1.

> > > >

> > > > :-) I am going to go though all your posts to see if this is true!

> > >

> > > 23,401 left to do!

> >

> > 23,377 left to do!

>

> 7,212 left to do! Nearly there!

He's so brave Sir Sabre!

He does all the labour!

All he does is work-work-work!

Is he nuts and just berzerk?

No, he's so brave Sir Sabre!

He does all our labour!

kind regards,

Jos ;-)

JosAHa at 2007-7-20 19:49:53 > top of Java-index,Java Essentials,Java Programming...
# 18

> > I think maybe you should use code tags.... It will

> be

> > a little nicer to read.... just a thought

>

> This raises the question: if someone dumps a bunch of

> code in here,

> without using [code] ... [/code] tags, what

> would the probability be

> that the post does *not* end in italics? As a

> corollary: what would the

> probability be that the post does *not* end in

> boldface? ;-)

>

> kind regards,

>

> Jos

<humor>

Doesn't matter because 46.76% of all statistics are made up on the spot.

</humor>

Caffeine0001a at 2007-7-20 19:49:53 > top of Java-index,Java Essentials,Java Programming...
# 19
> <humor>> Doesn't matter because 46.76% of all statistics are made up on the spot.> </humor><nitpicker>That shows that still the majority of all statistics are solid and sound.</nitpicker>kind regards,Jos
JosAHa at 2007-7-20 19:49:53 > top of Java-index,Java Essentials,Java Programming...
# 20

> > <humor>

> > Doesn't matter because 46.76% of all statistics are

> made up on the spot.

> > </humor>

>

> <nitpicker>

> That shows that still the majority of all statistics

> are solid and sound.

> </nitpicker>

>

> kind regards,

>

> Jos ;-)

Okay, then 78.80% of all statistics are made up on the spot.

Caffeine0001a at 2007-7-20 19:49:53 > top of Java-index,Java Essentials,Java Programming...
# 21

> .76% of all statistics are

> made up on the spot.

It always amazes me how many people don't get that joke.

It is kind of like the joke:

<humor>

I hate prejudice people.

</humor>

The joke is in the sentence itself. A kind of recursive humor.

Caffeine0001a at 2007-7-20 19:49:53 > top of Java-index,Java Essentials,Java Programming...
# 22

> > .76% of all statistics are

> > made up on the spot.

>

> It always amazes me how many people don't get that joke.

>

> It is kind of like the joke:

>

> <humor>

> I hate prejudice people.

> </humor>

>

>

> The joke is in the sentence itself. A kind of recursive humor.

I sometimess utter this one: "I have a perfect memory: I can't

remember I forgot anything in my whole life"

Most of the time people just nod affirmative ;-)

kind regards,

Jos

JosAHa at 2007-7-20 19:49:53 > top of Java-index,Java Essentials,Java Programming...
# 23
There's only two things I hate in this world: People who are intolerant of other people's cultures, and the Dutch
yawmarka at 2007-7-20 19:49:53 > top of Java-index,Java Essentials,Java Programming...
# 24
> There's only two things I hate in this world:> People who are intolerant of other people's cultures,> and the Dutch...P.S. "I don't know half of you half as well as I should like; and I like less than half of you half as well as you
yawmarka at 2007-7-20 19:49:53 > top of Java-index,Java Essentials,Java Programming...
# 25
> There's only two things I hate in this world: People who are > intolerant of other people's cultures, and the DutchThe Dutch are just like youkind regards,Jos
JosAHa at 2007-7-20 19:49:53 > top of Java-index,Java Essentials,Java Programming...
# 26

> > .76% of all statistics are

> > made up on the spot.

>

> It always amazes me how many people don't get that

> joke.

>

If someone asks me what time it is, and I reply "Do you mean right now?", surprisingly often what I get back is just a "Yes".

Of course, I'm not sure if they just don't get the joke, or if they just think I'm an idiot.

happy_hippoa at 2007-7-20 19:49:53 > top of Java-index,Java Essentials,Java Programming...
# 27

> If someone asks me what time it is, and I reply "Do you mean right now?"

If someone asks "do you know what time is it?", you should reply "yes"

and walk on. The ultimate, irritating, nerd kind of logic humour.

Second best is "coffee or tea?", "yes"; that should teach 'em ;-)

kind regards,

Jos

JosAHa at 2007-7-20 19:49:54 > top of Java-index,Java Essentials,Java Programming...
# 28

> > If someone asks me what time it is, and I reply "Do

> you mean right now?"

>

> If someone asks "do you know what time is it?", you

> should reply "yes"

> and walk on.

>

Nah, I prefer to be helpful. I really want to understand the problem before I attempt to provide a solution :-)

happy_hippoa at 2007-7-20 19:49:54 > top of Java-index,Java Essentials,Java Programming...
# 29

> > There's only two things I hate in this world: People who are

> > intolerant of other people's cultures, and the Dutch

>

> The Dutch are just like you

I googled that, but couldn't find the subreference (the former is from [url=http://www.imdb.com/title/tt0295178/]Austin Powers - Goldmember[/url]). See? It's that progressive new-year density I'm suffering... ;o)

yawmarka at 2007-7-20 19:49:54 > top of Java-index,Java Essentials,Java Programming...
# 30

> > > > > For my code it's probability 1.

> > > >

> > > > :-) I am going to go though all your posts to

> > see

> > > if

> > > > this is true!

> > >

> > > 23,401 left to do!

> >

> > 23,377 left to do!

>

> 7,212 left to do! Nearly there!

All done! Sorry about the delay but for some reason I had to have a nap. At may age this is normal!

There are 423 instances of jverd using 'i' as an index in a 'for' loop but 112 of them are based on other peoples code update by jverd.

sabre150a at 2007-7-20 19:49:59 > top of Java-index,Java Essentials,Java Programming...
# 31
s/may/my/s/update/updated/Obviously the effort of checking all jverd's posts has worn out my fingers.
sabre150a at 2007-7-20 19:49:59 > top of Java-index,Java Essentials,Java Programming...
# 32

The Saga

--

The Cast

--

- Sir Sabre (Hero)

- JosAH (Story Teller)

- Jverd (Enemy)

What happened in Previous Episodes

-

Story Teller: This raises the question: if someone dumps a bunch of

code in here, without using [code] ... [/code] tags, what would the

probability be that the post does *not* end in italics? As a corollary:

what would the probability be that the post does *not* end in boldface? ;-)

Hero: The same probabilty that the coder does not use 'i' as an index!

For the average code dropped here this is close to zero.

Enemy: For my code it's probability 1.

Hero: :-) I am going to go though all your posts to see if this is true!

Story Teller: Oh man, I hope you're not trying to tell us that you're one

of those quiche eating sissies that put spaces around their index

names like [ i ]? Or don't you use the mother of all index names at all?

Enemy: Except in shell scripts, I don't use single-letter variable names.

My loop indices are ix, jx, kx. Makes for easier search/replace. Or at least,

it did when I got into the habit before I had (or maybe just before I

learned how to use) regex search.

Hero: 23,401 left to do!

Hero: 23,377 left to do!

Enemy: Some people clearly have too much time on their hands.

Story Teller: Now hush; don't disturb Sabre; he's got important work to do!

Enemy: Maybe I can distract him and make him start all over.

[ terrible cacaphony and terrible curses deleted to protect the minors ]

Story Teller: He's so brave Sir Sabre! He does all the labour!

Hero: 7,212 left to do! Nearly there!

[ drum rolls ... ]

Hero:

.

/ \

/\

/\

/\

/ \

/\

+--+

| All done! Sorry about the delay but for some reason I had to have a nap. |

|At my age this is normal! |

| |

| There are 423 instances of jverd using 'i' as an index in a 'for' loop |

|but 112 of them are based on other peoples code update by jverd.|

+--+

Story Teller: and thus ends the Saga of the Great Hero Sir Sabre and the Foul

Enemy JVerd; of course Our Great Hero beat the Foul Enemy JVerd.

[curtain]

kind regards,

Jos ;-)

JosAHa at 2007-7-20 19:49:59 > top of Java-index,Java Essentials,Java Programming...
# 33

> > There's only two things I hate in this world:

> > People who are intolerant of other people's

> cultures,

> > and the Dutch...

>

>

> P.S. "I don't know half of you half as well as I

> should like; and I like less than half of you half as

> well as you deserve..."

and your intelligence is exceeded only by your great looks and wonderful charm.

kind regards

walken(<--never met a Dutchman that i hate)

p.s. Do I know Dutch?

walken16a at 2007-7-20 19:49:59 > top of Java-index,Java Essentials,Java Programming...
# 34
(Enemy's mask is peeled off to reveal the handsome young caretaker of the abandoned amusement park.)I would have gotten away with it too, if it weren't for you meddling geezers and your Dutchman!
jverda at 2007-7-20 19:50:00 > top of Java-index,Java Essentials,Java Programming...
# 35
> > [curtain]> > kind regards,> > Jos ;-)I am so happy that i did not miss out on this.I only wonder where i was when this thread started and why it took me so long to find it!kindly enjoyingwalken
walken16a at 2007-7-20 19:50:00 > top of Java-index,Java Essentials,Java Programming...
# 36

> Story Teller: and thus ends the Saga of the Great

> Hero Sir Sabre and the Foul

> Enemy JVerd; of course Our Great Hero beat the Foul

> Enemy JVerd.

>

> [curtain]

>

> kind regards,

>

> Jos ;-)

:-) Of course Jos, this may only be the end of Act 1 because JVerd may dispute my findings (in his place I would)!

Time for another nap!

sabre150a at 2007-7-20 19:50:00 > top of Java-index,Java Essentials,Java Programming...
# 37

> :-) Of course Jos, this may only be the end of Act 1 because JVerd

> may dispute my findings (in his place I would)!

Act II of Play I is a terrible act (PG16): when our Hero (you) peels off the

mask of the Foul Enemy (jverd), it reveals a bunch of wobbly maggots

inside (very much unlike reply #34), which immediatly run away in all

possible directions and attack Our Hero (you) as well. The Story Teller

(me), moves to a luxury appartment inhabited by a bunch of scantily

clad women where he has to pass most of his time.

> Time for another nap!

Take your rest Our Hero, you'll need it before you have to perform your

next Herculean Task.

kind regards,

Jos (Story Teller ;-)

JosAHa at 2007-7-20 19:50:00 > top of Java-index,Java Essentials,Java Programming...
# 38

> > Story Teller: and thus ends the Saga of the Great

> > Hero Sir Sabre and the Foul

> > Enemy JVerd; of course Our Great Hero beat the

> Foul

> > Enemy JVerd.

> >

> > [curtain]

> >

> > kind regards,

> >

> > Jos ;-)

>

> :-) Of course Jos, this may only be the end of Act 1

> because JVerd may dispute my findings (in his place I

> would)!

That smacks of effort. No thanks. I'll simply point out that your mother was a hamster and your father smelt of elderberries, ergo I'm right and you're wrong, QED.

jverda at 2007-7-20 19:50:00 > top of Java-index,Java Essentials,Java Programming...
# 39

> > > Story Teller: and thus ends the Saga of the Great Hero Sir Sabre and the Foul

> > > Enemy JVerd; of course Our Great Hero beat the Foul Enemy JVerd.

> > >

> > > [curtain]

> >

> > :-) Of course Jos, this may only be the end of Act 1 because JVerd

> > may dispute my findings (in his place I would)!

>

> That smacks of effort. No thanks. I'll simply point out that your mother

> was a hamster and your father smelt of elderberries, ergo I'm right and you're

> wrong, QED.

Run away! Run away! JVerd turned out to be the evil killer rabbit! Run away!

kind regards,

Jos (knight of camelot, I have to push the pram alot ;-)

JosAHa at 2007-7-20 19:50:00 > top of Java-index,Java Essentials,Java Programming...
# 40
> I'll simply point> out that your mother was a hamster and your father> smelt of elderberries, ...:-) How did you know these two facts? I try to keep this information very quiet so you must be psychedelic (or something).
sabre150a at 2007-7-20 19:50:00 > top of Java-index,Java Essentials,Java Programming...
# 41

> > I'll simply point

> > out that your mother was a hamster and your father

> > smelt of elderberries, ...

>

> :-) How did you know these two facts? I try to keep

> this information very quiet so you must be

> psychedelic (or something).

A little filly told me.

jverda at 2007-7-20 19:50:00 > top of Java-index,Java Essentials,Java Programming...
# 42
> A little filly told me.I'll bet it was a nightmare.
yawmarka at 2007-7-20 19:50:00 > top of Java-index,Java Essentials,Java Programming...