목록randomway (1)
codinghatso
python 에서 제공하는 turtle 라이브러리를 사용하여 랜덤으로 목적지를 지정하여 그곳을 찾아가는 AI를 만들어 보았습니다. 탐색한 횟수를 기록하여 성능을 체크하였습니다. from turtle import * import random #%% target 난수 생성 targetX = (random.randint(-10, 10)) * 10 targetY = (random.randint(-10, 10)) * 10 mypen=Turtle() #%% 울타리 그리기 mypen.penup() mypen.pencolor("black") mypen.setposition(-100,-100) mypen.pendown() for x in range(4): mypen.forward(200) mypen.left(90) #%..
AI/python
2021. 9. 14. 15:33