g.....d...
代表一个停车场 .代表空位置 字母代表车##是我的车 现在要把车开出去 (你可以上下左右移动其他车) 如何写下面的简单方法?
/* isValidLocation(l) returns true iff l represents a location within
the bounds of the carpark.
*/
static bool isValidLocation(LOCATION l)
{
if location1==1;
return true;
}
/* isValidCarparkEntry(c) returns true iff c is a valid character that
can appear in a carpark-file.
*/
static bool isValidCarparkEntry(char c)
{
return true;
}
/* trimLine(line) removes any trailing new-line or carriage-return
characters from the end of line.
*/
static void trimLine(char line[])
{
}
/* getValue(l) returns the character representing the car segment
occupying location l in the carpark.The function terminates the program
if the location is not valid (i.e. outside the bounds of the carpark).
*/
static char getValue(LOCATION l)
{
return EMPTY;
}
十分感谢!!