# Scheme recursive function help.

Page 1 of 1

## 2 Replies - 2544 Views - Last Post: 03 June 2012 - 02:02 AM

### #1 nacholibre

• D.I.C Head

Reputation: 1
• Posts: 76
• Joined: 19-September 09

# Scheme recursive function help.

Posted 03 May 2012 - 08:38 PM

I have a recursive function i have to emplement with sudo code as such

```function( c y)
int x = 4
int y= 5
if z = x return g
if(m = j) return f
for(.....){
i = p
sol<- function( p q)
q = 5
}
return x

```

All the variables and names i used here are random just to show how the C sudocode looks.
I dont know how to implement this correctly. there is no return in scheme so this recursive call is correctly excuted.
can someone show me how to do this? I am working on AI project and my issue is scheme and not the algo! Due in 1h. thank you

Is This A Good Question/Topic? 0

## Replies To: Scheme recursive function help.

### #2 turboscrew

• D.I.C Addict

Reputation: 103
• Posts: 679
• Joined: 03-April 12

## Re: Scheme recursive function help.

Posted 03 May 2012 - 09:48 PM

A bit too randomly selected variable names. The algorithm is not undersandable.

Also, for-loop in scheme? Doable, but odd especially with recursive call in the loop.
Was This Post Helpful? 0

### #3 Tayacan

• D.I.C Regular

Reputation: 145
• Posts: 275
• Joined: 18-January 11

## Re: Scheme recursive function help.

Posted 03 June 2012 - 02:02 AM

Your pseudo code doesn't really make sense, as turboscrew said - you pass y as a parameter, then you redefine it to something else, then you try to use the variables z and g that you never defined...
Was This Post Helpful? 0

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }