Guest User

Untitled

a guest
May 22nd, 2019
72
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. TSEA83 PROJECT USER PROGRAM
  3.  
  4. LS - A program for printing all user programs
  5. */
  6.  
  7. int ls() {
  8. int i = 0;
  9.  
  10. char *name = USER_PROGRAMS;
  11.  
  12. // Print all user program names
  13. while (i < USER_PROGRAM_COUNT) {
  14. int length = string_length(name);
  15. print(name);
  16. name = name + length + 1;
  17. }
  18.  
  19. new_line();
  20. new_line();
  21.  
  22. char str[] = "Press ESC to quit.";
  23.  
  24. print(str);
  25.  
  26. // Poll for quit
  27. char keyboard = 0;
  28. while (keyboard != '\e'){
  29. keyboard = read_char();
  30. }
  31. }
RAW Paste Data