[racket-users] Re: Checking if two lists contain a word

2017-06-29 Thread philipp . thiess1999
Am Sonntag, 25. Juni 2017 19:40:08 UTC+2 schrieb philipp.t...@gmail.com: > Hello its me again, > > I have the task to make a funcition who checks if two lists contain a word. > > I made a function which does that with one lst but I dont find a way to do it > with two lists. There must be some ea

Re: [racket-users] Re: Checking if two lists contain a word

2017-06-28 Thread David Storrs
On Wed, Jun 28, 2017 at 3:33 AM, wrote: > Thanks guys the tips made me have the idea that I can just write the check > for the second list instead of '(true). > > Here is my solution: > > #lang racket > > > (define (test1 word book book2) > > (cond ((null? book) '(false)) > > ((

[racket-users] Re: Checking if two lists contain a word

2017-06-28 Thread philipp . thiess1999
Thanks guys the tips made me have the idea that I can just write the check for the second list instead of '(true). Here is my solution: #lang racket (define (test1 word book book2) (cond ((null? book) '(false)) ((equal? word (first book)) (cond ((null? book2) '(false))

Re: [racket-users] Re: Checking if two lists contain a word

2017-06-26 Thread David Storrs
To expand on Vityou's hint a bit: You have already written a function that lets you answer the question "Is it true that this word appears in this list?" You now need to answer the following: "Is it true that this word appears in this list? And is it true that this word appears in this other lis

[racket-users] Re: Checking if two lists contain a word

2017-06-26 Thread philipp . thiess1999
Hello I tried another version but it doesnt work. Can anyone help me? Using the "and" function didnt help me. #lang racket (define (checker wort liste1 liste2) (cond ((and (equal? (first liste1) wort) (equal? (first liste2) wort)) '(true)) ((or (null? liste1)

[racket-users] Re: Checking if two lists contain a word

2017-06-25 Thread Vityou
Try taking a look at the `and` function: https://docs.racket-lang.org/reference/if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._and%29%29 On Sunday, June 25, 2017 at 11:40:08 AM UTC-6, philipp.t...@gmail.com wrote: > Hello its me again, > > I have the task to make a funciti