Question: Can you help me fix the following octave/matlab program? It says error: parse error near line 5 of file FILE PATH syntax error >>> if

Can you help me fix the following octave/matlab program? It says

error: parse error near line 5 of file FILE PATH

syntax error

>>> if wordsearch[row][col]=="-"

Program:

Function randomFill(wordsearch) Letters="ABCDEFGHIJKLMNOPQRSTUVZ" for row=0:12 for col=0:12 if wordsearch[row][col]=="-" ramdomletter=random.choice(LETTERS) wordsearch[row][col]=randomletter

Function displaywordsearch(wordsearch) fprintf(" _________________________") fprintf("| |") for col=0:12 line="| " for col=0:12 line = line + wordsearch[row][col] + " " line = line + "|" fprintf(line) fprintf("|_________________________|")

Function addRowWord(word,wordsearch) row=random.randint(0,11) col=random.randint(0,11-length(word)) for i=0:length(word) wordsearch[row][col+i]=word[i]

Function addColumnWord(word,wordsearch) row=random.randint(0,11-len(word)) col=random.randint(0,11) for i=0:len(word) wordsearch[row+i][col]=word[i] Function wordResearch(word,wordsearch) for i=0:12 for j=0:12-length(word)+1 if wordsearch[i][j] == word[0] is_found = True for k=0:len(word) if wordsearch[i][j+k]!=word[k] is_found = False if is_found fprintf(word+" is found at row",i+1, ", column ",j+1 ,")") return if wordsearch[j][i] == word[0] is_found = True for k=0:length(word) if wordsearch[j+k][i]!=word[k] is_found = False if(is_found): fprintf(word+" is found at row",j+1, ", column ",i+1 ,")") return fprint(word+" is not found.") wordsearch = [] for row=0:12 wordsearch.append([]) for col=0:12 wordsearch[row].append("-")

addRowWord("OVTAVE",wordsearch) addColumnWord("ALGORITHM",wordsearch) addRowWord("PUZZEL",wordsearch) addColumnWord("SEARCH",wordsearch)

randomFill(wordsearch)

displayWordsearch(wordsearch)

wordResearch("OCTAVE",wordsearch) wordResearch("ALGORITHM",wordsearch) wordResearch("PUZZEL",wordsearch) wordResearch("SEARCH",wordsearch)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!