Simple question which sadly I cannot find an answer to. Basically Im finishing up my ternary tree Program (it was in another thread) but I Have the Insert/ and print functions done.
problem is is that I need to read in integers into a list before I run the insert/print function on them.
Anyways Before I was using an example list.
So it'd be something like this:
Read In value---> 5 (user inputs value)
Run Insert/then print on that
Read in value.....
Run Insert/print
Read In value
etc...
And go on until I stop inputting numbers.
but I want it to do the insert function and print function as the values come in. So first it does it with 1 value.....then with 2 values......etc
I figured the test function should be the same. but I just have some kinda function that asks for another Integer for the list, and then adds it to it.
So something like this?
thanks a bunch
problem is is that I need to read in integers into a list before I run the insert/print function on them.
Anyways Before I was using an example list.
(defparameter *MYLIST*
(list 4 6 4 18 8 2 14 7 15 5 19 12 15 5 9 0 17 2 2 19))
But I need to make it where I read in the numbers, like ask the user for numbers until they hit N or something to stop. then put them into a list. and then run the insert/print function as I read in each value.So it'd be something like this:
Read In value---> 5 (user inputs value)
Run Insert/then print on that
Read in value.....
Run Insert/print
Read In value
etc...
And go on until I stop inputting numbers.
(defun T-tree()
(let ((test nil))
(dolist (run *MYLIST*)
(insert test run)
(print (print-tree)))
Right now this Goes through the "example" list I have (named MYLIST) and goes through each Value and does it.but I want it to do the insert function and print function as the values come in. So first it does it with 1 value.....then with 2 values......etc
I figured the test function should be the same. but I just have some kinda function that asks for another Integer for the list, and then adds it to it.
So something like this?
(defun T-tree()
(let ((test nil))
(askuser) #Ask for Next integer to be put into *MYLIST*
(dolist (run *MYLIST*)
(insert test run)
(print (print-tree)))
Ideas? Criticism? Comments?thanks a bunch