What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [release] Tic Tac Toe 2

[release] Tic Tac Toe 2
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: [release] Tic Tac Toe 2
quote:
Originally posted by roflmao456
quote:
Originally posted by CookieRevised

code:
if(Message.substr(0,3)!="!a1"){
if(Message.substr(0,3)!="!a2"){
if(Message.substr(0,3)!="!a3"){
if(Message.substr(0,3)!="!a1"){
if(Message.substr(0,3)!="!a2"){
if(Message.substr(0,3)!="!a3"){
if(Message.substr(0,3)!="!b1"){
if(Message.substr(0,3)!="!b2"){
if(Message.substr(0,3)!="!b3"){
if(Message.substr(0,3)!="!c1"){
if(Message.substr(0,3)!="!c2"){
if(Message.substr(0,3)!="!c3"){
//dosomething
}}}}}}}}}


that is saying "if the message at 0,3 doesn't equal *this*, do this." ... should it be "if the message at 0,3 equals *this*, do this" ?
No

it should be if the message at 0,3 doesn't equal *this* AND doesn't equal *this* AND doesn't equal *this  AND doesn't equal *this  AND doesn't equal *this  AND doesn't equal *this  AND doesn't equal *this  AND doesn't equal *this  AND doesn't equal *this  AND doesn't equal *this*, then do something.

quote:
Originally posted by CookieRevised
- Chage stuff like
code:
if(Message.substr(0,3)!="!a1"){
if(Message.substr(0,3)!="!a2"){
if(Message.substr(0,3)!="!a3"){
if(Message.substr(0,3)!="!a1"){
if(Message.substr(0,3)!="!a2"){
if(Message.substr(0,3)!="!a3"){
if(Message.substr(0,3)!="!b1"){
if(Message.substr(0,3)!="!b2"){
if(Message.substr(0,3)!="!b3"){
if(Message.substr(0,3)!="!c1"){
if(Message.substr(0,3)!="!c2"){
if(Message.substr(0,3)!="!c3"){
//dosomething
}}}}}}}}}
to at least 1 check using an AND operator.
Or better yet, use a single regular expression.

So start by properly indenting your entire code (isn't the first time I strongly suggest you do this) and see what you exactly made with all those IF THEN's. A massive bunch of nested IF THEN....

This entire forest of IF THENs can be made into 1 simple check using alogical AND operator (aka: use  &&).


...or learn regular expressions and put that entire bunch into one short check. PS: nope I'm not going to give you the regular expression as I want you to convert that whole bunch into 1 proper IF THEN check first :p

This post was edited on 12-19-2006 at 02:44 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-19-2006 02:41 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[release] Tic Tac Toe 2 - by roflmao456 on 12-12-2006 at 11:18 PM
RE: [release] Tic Tac Toe 2 - by DarkMe on 12-12-2006 at 11:40 PM
RE: [release] Tic Tac Toe 2 - by Spunky on 12-12-2006 at 11:57 PM
RE: RE: [release] Tic Tac Toe 2 - by deAd on 12-13-2006 at 12:44 AM
RE: [release] Tic Tac Toe 2 - by CookieRevised on 12-13-2006 at 01:52 AM
RE: [release] Tic Tac Toe 2 - by Spunky on 12-13-2006 at 02:07 AM
RE: RE: [release] Tic Tac Toe 2 - by deAd on 12-13-2006 at 02:58 AM
RE: [release] Tic Tac Toe 2 - by CookieRevised on 12-13-2006 at 02:11 AM
RE: [release] Tic Tac Toe 2 - by Spunky on 12-13-2006 at 04:01 AM
RE: [release] Tic Tac Toe 2 - by roflmao456 on 12-13-2006 at 11:44 PM
RE: RE: [release] Tic Tac Toe 2 - by CookieRevised on 12-19-2006 at 02:41 AM
RE: [release] Tic Tac Toe 2 - by NanaFreak on 12-13-2006 at 11:53 PM
RE: RE: [release] Tic Tac Toe 2 - by roflmao456 on 12-13-2006 at 11:55 PM
RE: [release] Tic Tac Toe 2 - by NanaFreak on 12-14-2006 at 12:02 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On