problems with scheme (Drscheme)

a google-like search engine

Page 1 of 1

1 Replies - 2721 Views - Last Post: 01 May 2007 - 05:13 AM Rate Topic: -----

#1 UNIBALL  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 27-April 07

problems with scheme (Drscheme)

Posted 27 April 2007 - 02:16 AM

hi all

im a new Scheme user and i have some problems when practicing on the following questions:

Quote

1. convert strings to word, for example
(string-the-word " Hello, everyone. I need your help!")
and should return
(list "Hello" "everyone" "I" "need" "your" "help")


where string-the-word recognizes a character string as its argument then returns a list of the words entered in the string.

also i have played around with string->list, string-append, and char-alphabetic? , but couldn't figure it out

________________________________________________

2. then i was writing some codes that compare the match words from two lists then return the the result in percentage of matches
(I used quotient for this)

for example,

Quote

(matches? (list "Hello" "Everyone") (list "Hello" "Everyone" "My" "Name" "is" "Drscheme"))


should return 33 (%)
where
(quotient (* 2 100) 6) = 33
the 2 stands for the number of word that matches to the list
and 6 is the total number of the word in the list

but i really have no idea how to do the rest...like how to join them together

can someone please help me with this
thanks very much!

Is This A Good Question/Topic? 0
  • +

Replies To: problems with scheme (Drscheme)

#2 gregoryH  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 60
  • View blog
  • Posts: 656
  • Joined: 04-October 06

Re: problems with scheme (Drscheme)

Posted 01 May 2007 - 05:13 AM

View PostUNIBALL, on 27 Apr, 2007 - 02:16 AM, said:

hi all

im a new Scheme user and i have some problems when practicing on the following questions:

Quote

1. convert strings to word, for example
(string-the-word " Hello, everyone. I need your help!")
and should return
(list "Hello" "everyone" "I" "need" "your" "help")


where string-the-word recognizes a character string as its argument then returns a list of the words entered in the string.

also i have played around with string->list, string-append, and char-alphabetic? , but couldn't figure it out

________________________________________________

2. then i was writing some codes that compare the match words from two lists then return the the result in percentage of matches
(I used quotient for this)

for example,

Quote

(matches? (list "Hello" "Everyone") (list "Hello" "Everyone" "My" "Name" "is" "Drscheme"))


should return 33 (%)
where
(quotient (* 2 100) 6) = 33
the 2 stands for the number of word that matches to the list
and 6 is the total number of the word in the list

but i really have no idea how to do the rest...like how to join them together

can someone please help me with this
thanks very much!

Hi

Just a gentle reminder that you should post your code to show good faith and compliance with this sites rules.

once you do this, we will help you.

regards


Greg
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1