開発環境
- OS X Yosemite - Apple (OS)
- Emacs (CUI)、BBEdit - Bare Bones Software, Inc. (GUI) (Text Editor)
- Python 3.4 (プログラミング言語)
Python for Kids: A Playful Introduction to Programming (Jason R. Briggs (著) 、No Starch Press)のPart Ⅰ.(Learning to Program)、Chapter 11.(More Turtle Graphics)、Programming Puzzles #1: Drawing an Octagon(No. 3093)を解いてみる。
Programming Puzzles #1: Drawing an Octagon(No. 3093)
コード(Emacs, BBEdit)
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
import turtle
t = turtle.Pen()
for x in range(8):
t.forward(100)
t.left(45)
while True:
pass
入出力結果(Terminal, IPython)
$ ./sample1.py C-c C-cTraceback (most recent call last): File "./sample1.py", line 13, in <module> pass KeyboardInterrupt $
0 コメント:
コメントを投稿