Pi_Mastuh Posted March 7, 2007 Share Posted March 7, 2007 How would I make a script using for loops to figure out this equation: EDCBA x 4 = ABCDE Each letter represents a number and i need to know what ABCDE is. Anyone know? Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted March 7, 2007 Share Posted March 7, 2007 How would I make a script using for loops to figure out this equation: EDCBA x 4 = ABCDE Each letter represents a number and i need to know what ABCDE is. Anyone know? what the hell are you talking about? Quote Link to comment Share on other sites More sharing options...
interpim Posted March 7, 2007 Share Posted March 7, 2007 ROFL, sounds like extra credit Algebra homework... I sucked at Algebra Good Luck Quote Link to comment Share on other sites More sharing options...
Pi_Mastuh Posted March 7, 2007 Author Share Posted March 7, 2007 I'm trying to solve this equation with php for loops. Each letter represents a number and i need to figure out what each letter represents as a number. Quote Link to comment Share on other sites More sharing options...
Pi_Mastuh Posted March 7, 2007 Author Share Posted March 7, 2007 It's not homework, it's something I'm working on for my site. Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted March 7, 2007 Share Posted March 7, 2007 try this: <?php $string = "EDCBA"; $answer = "ABCDE"; $temp = intval($string) * 4; if($temp == intval($answer)){ echo "this worked! ABCDE = ". $temp ."<br />\n"; }else{ echo "this did not work.<br />\n"; echo "EDCBA = ". $temp ."<br />\n"; echo "ABCDE = ". intval($answer) ."<br />\n"; } ?> i'm very curious to see if this worked. Quote Link to comment Share on other sites More sharing options...
Pi_Mastuh Posted March 7, 2007 Author Share Posted March 7, 2007 I need to know what each letter equals as a number, for example it could be ABCDE is 12345 so 12345*4=54321 (Not the answer though) Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted March 7, 2007 Share Posted March 7, 2007 I need to know what each letter equals as a number, for example it could be ABCDE is 12345 so 12345*4=54321 (Not the answer though) did you try the code? if it works i can tweak it to tell you the value of each letter, but it has to work first. tell me if it worked. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.