View Single Post
  #2  
Old 04-14-2007, 10:42 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Interesting, although I feel randomstring(array); might be a bit more useful here (should avoid index stuff):
PHP Code:
 function Calculate()
{
 
this.random int(random(0,this.alphabet.size()));
 if (
this.random != this.random_last)
  {
   
this.random_last this.random;
   
container_game_text.text "Press '" this.alphabet[this.random] @ "'";
   
container_game_text.135;
  }
 else
  {
   
Calculate();
  }

Something like:
PHP Code:
function calculate()
{
  
this.random randomstring(this.alphabet);

  if (
this.random != this.random_last)
  {
    
this.random_last temp.letter;

    
container_game_text.text format("Press '%s'"this.random);
    
container_game_text.135;
  }
    else
  {
    
this.calculate();
  }

Also, while it's probably nice that you've tried to demonstrate this, it's a bit misleading and probably not that efficient either, since you are running a check twice:
PHP Code:
if (this.container_on "On" "Off" == "On"
Perhaps changing it to standard true/false values and using:
PHP Code:
if (this.container_on
__________________
Skyld

Last edited by Skyld; 04-14-2007 at 11:19 AM..
Reply With Quote