Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

JavaScript AI

Name: Anonymous 2010-07-21 16:10

Name: FrozenVoid 2011-10-10 0:07

>>27 You could at least optimize the code.
 these all can be replace with tax=equity,
if (equity == 1) tax = 1;
  if (equity == 2) tax = 2;
  if (equity == 3) tax = 3;
  if (equity == 4) tax = 4;
  if (equity == 5) tax = 5;
  if (equity == 6) tax = 6;
  if (equity == 7) tax = 7;
  if (equity == 8) tax = 8;
  if (equity == 9) tax = 9;
  if (equity == 10) tax = 10;
  if (equity == 11) tax = 11;
  if (equity == 12) tax = 12;
  if (equity == 13) tax = 13;
  if (equity == 14) tax = 14;
  if (equity == 15) tax = 15;
  if (equity == 16) tax = 16;

  if (tax==1) concept.style.setAttribute('top', '250');
  if (tax==2) concept.style.setAttribute('top', '270');
  if (tax==3) concept.style.setAttribute('top', '290');
  if (tax==4) concept.style.setAttribute('top', '310');
  if (tax==5) concept.style.setAttribute('top', '330');
  if (tax==6) concept.style.setAttribute('top', '350');
  if (tax==7) concept.style.setAttribute('top', '370');
this can be replaced as concept.style.setAttribute('top', 230+20*tax);

if (brevity > 0)  wipeSubject("sun" + 1);
  if (brevity > 1)  wipeSubject("sun" + 2);
  if (brevity > 2)  wipeSubject("sun" + 3);
  if (brevity > 3)  wipeSubject("sun" + 4);
  if (brevity > 4)  wipeSubject("sun" + 5);
  if (brevity > 5)  wipeSubject("sun" + 6);
  if (brevity > 6)  wipeSubject("sun" + 7);
  if (brevity > 7)  wipeSubject("sun" + 8);
  if (brevity > 8)  wipeSubject("sun" + 9);
  if (brevity > 9)  wipeSubject("sun" + 10);
can be replaced by this: while(brevity)wipeSubject("sun" + (brevity--))

  if (tur==1) answer.style.setAttribute('top', '240');
  if (tur==2) answer.style.setAttribute('top', '260');
  if (tur==3) answer.style.setAttribute('top', '280');
  if (tur==4) answer.style.setAttribute('top', '300');
  if (tur==5) answer.style.setAttribute('top', '320');
  if (tur==6) answer.style.setAttribute('top', '340');
can be replaced by  answer.style.setAttribute('top', 220+ tur*20);

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List