我需要使用 jython (JES) 向 .png 地图添加线条,使用整数表示有多少个城市,另一个输入从 0 到 9 的城市编号,我必须使用下面的 X 和 Y 坐标(即 0 = 45,310) 在第二个整数之前一切正常,然后我的编码从那一点开始。我很感激任何帮助谢谢。
import random
def mapLevel1():
file=pickAFile()
mapLevel1=makePicture(file)
city1=requestInteger("How many cities would you like to visit?")
cityNum=requestInteger("Enter the number of the city")
cityXValue=[ 45, 95,182,207,256,312,328,350,374,400]
cityYValue=[310,147, 84,201,337,375,434,348,335,265]
0=addLine(mapLevel1,45,310)
1=addLine(mapLevel1,95,147)
2=addLine(mapLevel1,182,84)
3=addLine(mapLevel1,207,201)
4=addLine(mapLevel1,256,337)
5=addLine(mapLevel1,312,375)
6=addLine(mapLevel1,328,434)
7=addLine(mapLevel1,350,348)
8-addLine(mapLevel1,374,335)
9=addLine(maplevel1,400,265)
if 0
print cityXValue[0]
print cityYValue[0]
if cityNum=1
print cityXValue[1]
print cityYValue[1]
if cityNum=2
print cityXValue[2]
print cityYValue[2]
if cityNum=3
print cityXValue[3]
print cityYValue[3]
if cityNum=4
print cityXValue[4]
print cityYValue[4]
if cityNum=5
print cityXValue[5]
print cityYValue[5]
if cityNum=6
print cityXValue[6]
print cityYValue[6]
if cityNum=7
print cityXValue[7]
print cityYValue[7]
if cityNum=8
print cityXValue[8]
print cityYValue[8]
if cityNum=9
print cityXValue[9]
print cityYValue[9]
return mapLevel1