tayfunatasayar Posted November 18, 2006 Share Posted November 18, 2006 Hi,Can you help me for my homework =)TEST TSETTES SETTE ETT Tandjs will want name and surname from me.name = prompt("Name");surname = prompt("Surname");and resultN <red>Na <blue>Nam <green>Name Surname <blue>Nam <green>Na <green>N <green> Link to comment Share on other sites More sharing options...
Chocolate570 Posted November 18, 2006 Share Posted November 18, 2006 1) We're not here to do your homework. Please give it an attempt, and then tell us what you have so far. We'll help you from there.2) I can't understand anything you just wrote. Could you explain a bit more? Link to comment Share on other sites More sharing options...
tayfunatasayar Posted November 18, 2006 Author Share Posted November 18, 2006 how can i reserve string values?For example;TAYFUN NUFYATTAYFU----UFYATTAYF-------FYATTAY-.-.-.-.-.YATTA-.-.-.-.-.-.-ATT-.-.-.-.-.-..--.Ttayfun is a value what entered with prompt.. like that; function Text(){ name=prompt("Name","");window.document.write( ad +"" +"<br>");for(var i=name.length ; i>=0 ; i--){ window.document.write( name.substring(i-1,0) + "<br>"); } }Result............... Link to comment Share on other sites More sharing options...
Webworldx Posted November 18, 2006 Share Posted November 18, 2006 I have no idea what the lines are in the middle, but if you're just looking to take a string, and write it and its reverse on a line, then remove a character from it, and repeat writing it and its reverse until you have one character, then... <script type='text/javascript'>/*Normal & Reverse PrintCreated by Webworldxhttp://w3schools.com*/var myString = "Hello"function reverse_print_remove(txt){ if(txt.length == 0) return false; document.write( txt + " " ); document.write( txt.split("").reverse().join("") ); document.write( "<br />" ); txt = txt.substring(0,txt.length-1); reverse_print_remove(txt);}reverse_print_remove(myString);</script> Note you'll have to know how that works, and if it's part of your homework, you'll want to rewrite it for yourself or attribute it appropriately. Link to comment Share on other sites More sharing options...
tayfunatasayar Posted November 18, 2006 Author Share Posted November 18, 2006 So thanks. You are n1 Link to comment Share on other sites More sharing options...
tayfunatasayar Posted November 25, 2006 Author Share Posted November 25, 2006 Webworldx, how can i do that with your codes? .,.,.,.,.,.,e.,.,.,.,.,xe.,.,.,.,axe .,.,.maxe.,.,pmaxe,..lpmaxeelpmaxeits not a homework thanks Link to comment Share on other sites More sharing options...
Webworldx Posted November 26, 2006 Share Posted November 26, 2006 Not quite sure what you mean? Do you just want it printing the other way around? Or do you want it printing the ".,.," too? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now