Guest User

Untitled

a guest
Jun 23rd, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <?php
  2.  
  3. function dollar($desired, $current, $string=""){
  4. if($desired>$current){
  5. $string = $string.'$';
  6. dollar($desired, $current+1, $string);
  7. } else {
  8. print "$string\n";
  9. }
  10. }
  11.  
  12. function up($desired, $current){
  13. if($desired>$current){
  14. $current++;
  15. dollar($current, 0, "");
  16. up($desired,$current);
  17. }
  18. }
  19.  
  20. function down($desired, $current){
  21. if($current>0){
  22. dollar($current, 0, "");
  23. $current--;
  24. down($desired, $current);
  25. }
  26. }
  27.  
  28. function lines ($desired){
  29. up($lines,0);
  30. down($lines,$lines);
  31. }
  32.  
  33. lines(5);
  34.  
  35. ?>
Add Comment
Please, Sign In to add comment