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? Link to comment https://forums.phpfreaks.com/topic/41693-help-with-for-loops/ 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? Link to comment https://forums.phpfreaks.com/topic/41693-help-with-for-loops/#findComment-202071 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 Link to comment https://forums.phpfreaks.com/topic/41693-help-with-for-loops/#findComment-202072 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. Link to comment https://forums.phpfreaks.com/topic/41693-help-with-for-loops/#findComment-202073 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. Link to comment https://forums.phpfreaks.com/topic/41693-help-with-for-loops/#findComment-202074 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. Link to comment https://forums.phpfreaks.com/topic/41693-help-with-for-loops/#findComment-202085 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) Link to comment https://forums.phpfreaks.com/topic/41693-help-with-for-loops/#findComment-202090 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. Link to comment https://forums.phpfreaks.com/topic/41693-help-with-for-loops/#findComment-202096 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.