Hello All,

I'm a self-taught Javascript newbie trying to develop an Android App that works as a companion to
the Clue: Secrets and Spies board game. They used to have SMS text messaging service as an in game
bonus. Since the service is no longer active, I thought I would track down what the messages used to
look like and try rolling my own App that would act as that service to enhance game play. I have been using
online Lint for error checking )
I made some changes to the code trying to get it to add sound now I can't get anything to display! Online Lint doesn't think there is any problem.
The code worked after adding nested word components, and would show proper variable outputs (such as filling in an agent name and selecting the left hand equipment spot) I had tried removing all the comments and running it again. I'm too new to programming to have any idea what I did wrong. Please forgive my comments, they are for me

Now what can I do?

Ps. Once I have a working version of the App I will be speaking to the owners of the game about use of their intellectual property. In the meantime, it is a learning experiment



<script language= "javascript">

/* Fonts & Colors*/
document.bgColor= "#000000" ;
document.fgColor= '#008000';

/* Filling Arrays*/
var ragent= new Array( "Scarlet", "Mustard", "Plum", "White", "Green", "Peacock", "Black");
var ragent2= new Array( "Scarlet", "Mustard", "Plum", "White", "Green", "Peacock", "Black");
var rcity= new Array("LA", "Moscow", "NY", "Paris", "Sydney", "Singapore", "C.L.U.E.", "Tokyo", "Berlin", "London", "Cape Town", "Buenos Aires", "Miami");
var rLR= new Array("Left", "Right");
var movemod= new Array("1", "2");
var rupdown= new Array("up" , "down");
var ritem= new Array("Gun", "Diamond", "Briefcase", "Folder", "Phone", "Microchip", "Laptop");
var rMessage= new Array( "Briefcase - Game of Shadows: If agent Black is not activated, any agent of your choice (not Black) gets one point. If he is activated, move him one space back up on the scoring track.",
"Folder - Imposter: You may swap your Secret Identity card with another player or with one of the extra Secret Identity cards. Don’t look before you chose.",
"Diamond - Bait and Switch: Swap one item of any agent with another agent. If any agent has both items on your Mission card score points accordingly, then draw a new Mission card. (you cannot score again)",
"Gun - Lockdown: Close any of the home (colored) cities. Put an X token on it. Agents can exit the city, but not enter or pass through. If both X tokens are used, you may move one to a different city.",
"Robot - Dirty Tricks: Steal a completed Mission card or Secret Meeting card from a player that has more completed cards than you. If you have the most, do nothing.",
"Laptop - Parachute Drop: Move one agent of your choice to any open city on the board. If you move to the city shown on the Secret Meeting card, look at it, if you can complete the Secret Meeting, score points accordingly and flip over a new card. (you cannot score again)",
"Phone: - Abort Mission: All players must discard their Mission cards and draw new ones, also discard the current Secret Meeting card and flip over a new one.",
"Business: - Reveal the identity on the Meeting card and leave it face up next to the meeting card pile. You may go to either meeting." ,
"Hit & Run: - Drop all items agent " + (agent) + " is carrying, remove their action card if they have one. They start over in " + (city) + "." ,
"You have a additional meeting: You may meet agent " + (agent) + " in "(city) + "." ,
"Draw an extra mission card. You must discard the one you have." ,
"Draw your action card at the beginning of this turn, you may use it." ,
"You may move " + (move) + " extra city if you moves cities this turn." ,
"You must use agent " + (agent) + " this turn. Clear their action card if they have one." ,
"You may not use agent " + (agent) + "this turn." ,
"The " + (item) + " is now in " + (city) + "." ,
"Agent " + (agent) + " now has the " + (item) + " you may give or drop their " + (LR) + " item if they have one." ,
"Move your agent only one city. Do not use an action card." ,
"Agent " + (agent) + " moves " + (updown) + " the score marquee by 1." ,
"You may take 2 turns right now, if you do, skip your next turn." ,
"Agent " + (agent) + " gives their " + (LR) + " item to Agent " + (agent2) + "." ,
"Agent Black will be used first the next round." );

/* set up screen and say hello */
document.writeln('C.L.U.E. SMS system initiated; Agents are standing by.' + '<br>');

/* stuff I want to do 6 times; old for statement is on Main6.old */
for(i = 0; i < 6; i++){
/*Let's do some math; randomizing draw of each variable output.
Messagenum will become much higher, we are using 9 samples to begin with.

agentnum = Math.floor(Math.random() * 7);
agentnum2 = Math.floor(Math.random() * 7);
citynum = Math.floor(Math.random() * 13);
LRnum = Math.floor(Math.random() * 2);
movemodnum = Math.floor(Math.random() * 2);
updownnum = Math.floor(Math.random() * 2);
itemnum = Math.floor(Math.random() * 7);
Messagenum = Math.floor(Math.random() * rMessage.length);

/* No doubles, please*/
if (agentnum==agentnum2) {agentnum2 - 1 ; }
if (agentnum2 !== 0 ) {agentnum2 = (Math.floor(Math.random() * 6 )) + 1 ; }

/*solving additional nested components*/
var agent = ragent[agentnum];
var agent2 = ragent2[agentnum2];
var city = rcity[citynum];
var move = movemod[movemodnum];
var item = ritem[itemnum];
var LR = rLR[LRnum];
var updown = rupdown[updownnum];

/*messages will actually have (words + item + morewords) in them ((nested))*/

var words = rMessage[Messagenum];

/*components solved. Use of variables in Messages authorized :P .*/
/* audio syntax (html) <bgsound src="C:\Documents and Settings\soundtest\Desktop\Clinton\html txt game\sound\TYPE.wav" LOOP="3"> */

document.write (words + '<br>');

/*sleep(6000); */


/* output is correct (colors, program does as expected) a phone-looking interface, sound (if any). Timer prints another text message (loop not working?). */