본문 바로가기
Programming/LOGO

Another Flower - 1

by The Programmer 2025. 12. 13.

1. Introduction

 

중급 예제입니다. Another Flower - 1. 변수 활용 연습용. 

 

- 텍스트 표시

- 변수 활용

- repCount

 

 

 

2. Code

 

to box1 :side
    repeat 4 [ fd :side rt 90 ]
end

to boxes
    repeat 720 [     ;; 2160
        box1 :side pu rt 90 fd :side+5 lt 90 
        make "A repCount   ;; make "A repCount + 0.6669
        lt :A pd
        ; show [ repCount : ] Show repCount
        ; 테스트 용으로 사용
        ; show [ :A ] show :A
        ; show 명령은 제법 delay가 발생함.
    ]
end

to boxesxxxx
    repeat 720 [     ;; 2160
        box1 :side pu rt 90 fd :side+5 lt 90 
        make "A repCount + 0.6669
        lt :A pd
        ; show [ repCount : ] Show repCount
        ; 테스트 용으로 사용
        ; show [ :A ] show :A
        ; show 명령은 제법 delay가 발생함.
    ]
end

to displayText
    ; rt 90
    gotoCenter
    text1
    gotoNextLine
    text2
end

to draw
    ; SLOWDRAW 0
    ; for Slow Drawing
    ; FullScreen
    ; FullScreen, fs <--> SPLITSCREEN, ss
    setup
    boxes
    displayText
    flower1
    HT
end

to flower1
    repeat 12 [ boxes lt 30  fd 65 ]
end

to gotoCenter
    pu lt 90 fd 250 rt 90 fd 160 pd
end

to gotoNextLine
    pu back 30 pd
end

to main
    draw
end

to setup
    Window Home CS PPT PD ST 
    pu rt 90 fd 200 lt 90 back 100 pd
    make "side 6
    make "A 0
end

to text1
    rt 90
    label [ "YS is BABO! ^.^ ..." ]
    lt 90
end

to text2
    rt 90
    label [ "SH is BABO too! ^.^ ..." ]
    lt 90
end


 

3. Result

 

[ 이전에 만든 것 응용 ]

 

4. Notes

Not yet! ^.^;

 

■ 응용 연습 과제

1) 텍스트를 오른쪽 상단 빈 공간으로 옮겨보세요.

2) 그려진 도형을 꽃이라고 가정하고 꽃밭을 만들 수 있나요?

 

 

5. Files

 

- 응용 방법......

Flower_Version_Ex_001_.lgo
0.00MB

 

 

6. Ref.

 

1) FMSLogo v8.4.0 내장 도움말.

 

 

Be Happy with Programming!

^.^;

 

 

 

'Programming > LOGO' 카테고리의 다른 글

LOGO 3D 연습 : Castle - 001  (0) 2025.11.16
LOGO 3D - 002  (0) 2025.11.07
Logo 3D Ex. 001 - 기본 동작 1  (0) 2025.10.26
거북이 떼를 만나보세요 - 001  (0) 2025.08.07
컬러링 기초 연습 - 001  (0) 2025.06.29