smallcattle
Member
i wrote about a page of code, but its so messy...
That only checks for two seats in a row. The questions asks for two or more, so a different algorithm would be needed if you went for more than two.PoP 'n' Fresh said:that algorithm was easy!
it was basically copying their code, fixing the logic error, then for the if statement was:
IF array(row,seat) = "unsold" AND array(row,seat +1) = "unsold"
print array(row,seat), array(row,seat + 1)
End if
note: u had to change the while condition to <= 9, otherwise it would be an error trying to access out of bouns
i dont think that code will work as requiredPoP 'n' Fresh said:that algorithm was easy!
it was basically copying their code, fixing the logic error, then for the if statement was:
IF array(row,seat) = "unsold" AND array(row,seat +1) = "unsold"
print array(row,seat), array(row,seat + 1)
End if
note: u had to change the while condition to <= 9, otherwise it would be an error trying to access out of bouns
you were supposed to write one from scratch but it was easier to take parts of their algorithm.. because it did most of the jobWild Dan Hibiki said:WTF!!!!!! did u have to modify their algorithm? i made up one from scratch (although it was probly wrong)