Windows [ ] [ (R)..] cmd [OK] Z:\> mkdir progi [Enter] \ ) mkdir progi ) (command ) help [Enter] help ( help ) mkdir make directory Windows ) mkdir mk

Size: px
Start display at page:

Download "Windows [ ] [ (R)..] cmd [OK] Z:\> mkdir progi [Enter] \ ) mkdir progi ) (command ) help [Enter] help ( help ) mkdir make directory Windows ) mkdir mk"

Transcription

1 Ruby I I 1 Windows 1 Meadow 1: Meadow I Meadow 2 2 Ruby 2.1 I Z progi 1

2 Windows [ ] [ (R)..] cmd [OK] Z:\> mkdir progi [Enter] \ ) mkdir progi ) (command ) help [Enter] help ( help ) mkdir make directory Windows ) mkdir mkdir progi progi help [Enter] 3. help mkdir mkdir 4. cd dir move del copy 5. mkdir progi progi 2

3 2.2 (source program) 1 \ ) ) ) 1 print("hello, Ruby!\n") 2 print("hello, Ruby!\n") 2: Hello, Ruby! 2 Hello, Ruby! Hello, Ruby! hello.rb (suffix).rb ruby Z:\> \ ) ) cd progi [Enter] dir [Enter] progi hello.rb) ruby hello.rb (ruby ) Z:\>cd progi Z:\progI>dir... Z:\progI>ruby hello.rb 1 3

4 Hello, Ruby! Hello, Ruby! cd change directory Windows ) cd cd progi progi dir list directory dir <DIR> print Ruby "Hello, Ruby!\n" \n (") 1. Meadow 2. 2 Meadow ( 3. Z:\progI hello.rb 4. cd progi [Enter] Z progi ( cd progi ) 5. (> [Enter] ( : rubyhello.rb ) Z:\>cd progi Z:\progI>dir Z:\progI>ruby hello.rb Hello, Ruby! 2 4

5 2.3 (?) 2 2 ) ruby hello.rb 3 hello.rb:2: syntax error, unexpected $, expecting ) 3: "hello.rb" 2 2 syntax error, unexpected $, expecting ) $ ) ( ) 2 2 ) tab 1 x = if x == 10 4 print("x 10 \n") 5 else 6 print("x 10 \n") 7 4: sample0.rb sample0.rb 4 2 print 2 5

6 (indent) Meadow Ruby mode Meadow Ruby (.rb ) Ruby mode tab C-x h ESC C-\ sample0.rb 4 tab 4 6 C-x h ESC C-\ sample0.rb 3 Ruby (programming, ) 1. 2 print \n 2. 5 Ruby (suffix).rb 6

7 print("h") print("e") print("l") print("l") print("o\n") print("hello\n") 5: sample1.rb puts("hello") 6: sample2.rb print(2 + 3, "\n") print(2-3, "\n") print(2 * 3, "\n") print(2 / 3, "\n") print(2 ** 3, "\n") print(math.sin(3.14), "\n") print(math.sqrt(2), "\n") 7: sample3.rb print("hello\n") print("hello" + "ruby\n") print("hello" + " ruby" + " world!\n") 8: sample4.rb print("hello\n") print("hello" * 4 + "\n") 9: sample5.rb 7

8 a = 3 print(a, "\n") a = 3 b = 4 print("a = ", a, ",b = ", b, "\n") 10: sample6.rb a = 2 b = 3 11: sample7.rb print(a, " + ", b, " = ", a + b, "\n") print(a, " - ", b, " = ", a - b, "\n") print(a, " * ", b, " = ", a * b, "\n") print(a, " / ", b, " = ", a / b, "\n") i = 1 print("i = ", i, "\n") print("i = ", i, "\n") print("i = ", i, "\n") 12: sample8.rb 13: sample9.rb # 1 30 i = 1 while i <= 30 print(i, "\n") 14: sample10.rb 8

9 i = 0 while i < 10 print(i + 1, " \n") 15: sample11.rb print("hello!") print("hello!") print("hello!") print("-----\n") i = 0 while i < 3 print("hello!!") 16: sample12.rb # * i = 1 while i <= 10 j = 1 while j <= i print("*") j = j + 1 print("\n") 17: sample13.rb 9

10 # 1 10 total = 0 total = print("total = ", total, "\n") sum = 0 i = 1 while i <= 10 sum = sum + i print("sum = ", sum, "\n") 18: sample14.rb sum = 0 i = 0 x = [10, 20, 35, 40, 50] while i < x.length sum = sum + x[i] print("sum = ", sum, "\n") 19: sample15.rb 10

11 puts(" ") puts(" ") n = gets.chomp.to_i if n > 120 print(" 1 ", n - 120, " \n") elsif n == 120 print(" 1 \n") else print(120 - n, " \n") 20: sample16.rb sushi = {" " => 100, " " => 300, " " => 200} print(sushi[" "], "\n") print(sushi[" "], "\n") print(sushi[" "], "\n") 21: sample17.rb def hello(name) print(name, " \n") hello(" ") hello(" ") hello(" ") 22: sample18.rb 11

12 ( ) sample19.rb Enter require sdl print("?") n = gets.chomp.to_i SDL.init(SDL::INIT_VIDEO) screen = SDL.setVideoMode(300, 600, 16, SDL::SWSURFACE ) # interval = 1 i = 0 while i < n loop_start = SDL.getTicks/ x = i % 3 * 100 y = (i /3)*50 chara = SDL::Surface.load( zu1.gif ) screen.put(chara, x, y) screen.updaterect(0, 0, 0, 0) print(" ", i + 1, "..."); sleep(1.8) if i >= 29 print(" ") break print("\n \n") sleep(6) print("\n\n\n") print(" \n") 23: sample19.rb 12

Windows Cygwin Mac *1 Emacs Ruby ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2

Windows Cygwin Mac *1 Emacs Ruby ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2 September 2016 1 Windows Cygwin Mac *1 Emacs Ruby 1 1.1 ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2 ~/16:00:20> ls 2 2 ls ls -a ~/16:00:20> ls -a

More information

dynabookガイド

dynabookガイド 1 2 3 4 5 6 7 8 9 10 11 14 15 16 17 18 19 20 21 22 23 SHIFT SHIFT 24 25 SHIFT SHIFT 26 27 28 29 D Y N A B O O K BACKSPACE DEL 30 31 32 33 34 35 36 37 ENTER SHIFT SHIFT 38 39 40 41 FN F8 FN F8 42 43 ENTER

More information

ruby novice ruby novice ruby novice.

ruby novice ruby novice ruby novice. GitHub Ruby 2549 2017 3 1 1 3 2 4 2.1 ruby novice........................... 4 2.2.............................. 6 3 8 3.1 ruby novice....................... 8 3.2 ruby novice............................

More information

parser.y 3. node.rb 4. CD-ROM

parser.y 3. node.rb 4. CD-ROM 1. 1 51 2. parser.y 3. node.rb 4. CD-ROM 1 10 2 i 0 i 10 " i i+1 3 for(i = 0; i

More information

Python Speed Learning

Python   Speed Learning Python Speed Learning 1 / 89 1 2 3 4 (import) 5 6 7 (for) (if) 8 9 10 ( ) 11 12 for 13 2 / 89 Contents 1 2 3 4 (import) 5 6 7 (for) (if) 8 9 10 ( ) 11 12 for 13 3 / 89 (def) (for) (if) etc. 1 4 / 89 Jupyter

More information

GNU Emacs GNU Emacs

GNU Emacs GNU Emacs GNU Emacs 2015 10 2 1 GNU Emacs 1 1.1....................................... 1 1.2....................................... 1 1.2.1..................................... 1 1.2.2.....................................

More information

Emacs Ruby..

Emacs Ruby.. command line editor 27014533 2018 3 1 5 1.1................................... 5 1.2................................... 5 2 6 2.1 Emacs...................................... 6 2.2 Ruby.......................................

More information

dynabookガイド

dynabookガイド 1 2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 25 26 SHIFT SHIFT 27 28 SHIFT SHIFT 29 30 31 32 D Y N A B O O K BACKSPACE DEL 33 34 35 36 37 38 39 40 ENTER SHIFT SHIFT 41 42 43 44 FN F8 FN

More information

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I  Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~alse I Exercise on Programming I http://bit.ly/oitprog1 13 of 14 ( RD S ) I 13 of 14 1 / 39 https://bit.ly/oitprog1 ( RD S ) I 13 of 14 2 / 39 game.rb ( RD S ) I 13 of 14 3 / 39 game.rb 12 ( ) 1 require "io/console"

More information

リファレンス

リファレンス ii iii iv v vi NEC Corporation 1998 vii C O N T E N T S PART 1 PART 2 viii ix C O N T E N T S PART 3 PART 4 x xi C O N T E N T S PART 5 xii xiii xiv P A R T 1 2 1 3 4 5 1 6 7 1 8 1 9 10 11 1 12 13 1 14

More information

Python Speed Learning

Python   Speed Learning Python Speed Learning 1 / 76 Python 2 1 $ python 1 >>> 1 + 2 2 3 2 / 76 print : 1 print : ( ) 3 / 76 print : 1 print 1 2 print hello 3 print 1+2 4 print 7/3 5 print abs(-5*4) 4 / 76 print : 1 print 1 2

More information

X Window System X X &

X Window System X X & 1 1 1.1 X Window System................................... 1 1.2 X......................................... 1 1.3 X &................................ 1 1.3.1 X.......................... 1 1.3.2 &....................................

More information

インターネット入門

インターネット入門 PART 7 PART 8 ii PART 1 PART 2 PART 3 PART 4 PART 7 PART 4 PART 5 PART 6 iii iv v vi NEC Corporation 1998 vii C O N T E N T S PART 1 PART 2 viii PART 3 ix C O N T E N T S PART 4 PART 5 x PART 6 xi C O

More information

超初心者用

超初心者用 3 1999 10 13 1. 2. hello.c printf( Hello, world! n ); cc hello.c a.out./a.out Hello, world printf( Hello, world! n ); 2 Hello, world printf n printf 3. ( ) int num; num = 100; num 100 100 num int num num

More information

listings-ext

listings-ext (6) Python (2) ( ) [email protected] 5 Python (2) 1 5.1 (statement)........................... 1 5.2 (scope)......................... 11 5.3 (subroutine).................... 14 5 Python (2) Python 5.1

More information

離散数理工学 第 2回 数え上げの基礎:漸化式の立て方

離散数理工学 第 2回  数え上げの基礎:漸化式の立て方 2 [email protected] 2015 10 20 2015 10 18 15:29 ( ) (2) 2015 10 20 1 / 45 ( ) 1 (10/6) ( ) (10/13) 2 (10/20) 3 ( ) (10/27) (11/3) 4 ( ) (11/10) 5 (11/17) 6 (11/24) 7 (12/1) 8 (12/8) ( ) (2) 2015 10 20

More information

untitled

untitled [email protected] OK CNS OS CPU HDD FDD USB 1 (CPU) (CPU) CISCPentium4(Windows PC) RISCPowerPC(Macintosh PC) CPU CPU CPU CPU CD/DVD OS 2 OS Windows MacOS ( Talk, MacOSX) UNIX Word/Excel/PowerPoint etc..

More information

17. (1) 18. (1) 19. (1) 20. (1) 21. (1) (3) 22. (1) (3) 23. (1) (3) (1) (3) 25. (1) (3) 26. (1) 27. (1) (3) 28. (1) 29. (1) 2

17. (1) 18. (1) 19. (1) 20. (1) 21. (1) (3) 22. (1) (3) 23. (1) (3) (1) (3) 25. (1) (3) 26. (1) 27. (1) (3) 28. (1) 29. (1) 2 1. (1) 2. 2 (1) 4. (1) 5. (1) 6. (1) 7. (1) 8. (1) 9. (1) 10. (1) 11. (1) 12. (1) 13. (1) 14. (1) 15. (1) (3) 16. (1) 1 17. (1) 18. (1) 19. (1) 20. (1) 21. (1) (3) 22. (1) (3) 23. (1) (3) 24. 1 (1) (3)

More information

解きながら学ぶC言語

解きながら学ぶC言語 printf 2-5 37 52 537 52 printf("%d\n", 5 + 37); 5370 source program source file.c ex00.c 0 comment %d d 0 decimal -2 -p.6 3-2 5 37 5 37-22 537 537-22 printf("537%d\n", 5-37); function function call ( )argument,

More information

CD-ROM Ver.1Ver

CD-ROM Ver.1Ver 1 1 2 6 3 6 1 8 2 8 3 8 4.. 9 5 10 6.. 10 7.. 10 8 11 9 CD-ROM 11 10 11 1 13 1-1.. 13 1-2.. 15 2.. 16 2-1 Ver.1Ver.2.. 16 2-2. 18 2-3.. 34 2-4.. 35 2-5 45 1 49 1-1... 49 1-2. 51 1-2-1. 51 1-2-2. 55 1-2-3

More information

PC STATION S200L seriesファーストステップガイド

PC STATION S200L seriesファーストステップガイド 1 2 3 WindowsMe 2 1 2 3 4 5 3 1 2 3 7 3 4 2 1 6 5 6 4 5 6 7 7 Esc Caps Lock Ctrl F1 Alt F2 F3 F4 F5 F6 F7 F8 Alt F9 F10 F11 Ctrl F12 Back Space Print Scrn SysRq Insert Delete Scroll Lock Home End Pause

More information

明解Java入門編

明解Java入門編 1 Fig.1-1 4 Fig.1-1 1-1 1 Table 1-1 Ease of Development 1-1 Table 1-1 Java Development Kit 1 Java List 1-1 List 1-1 Chap01/Hello.java // class Hello { Java System.out.println("Java"); System.out.println("");

More information

オンラインマニュアル

オンラインマニュアル 1 2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 ENTER ENTER 20 F12 ENTER ENTER 21 FN F8 FN F8 22 FN F3 23 FN F4 24 25 26 27 28 FN F9 FN F9 FN F9 FN F9 FN F9 29 30 31 SHIFT SHIFT FN 32 33 FN FN ESC FN SPACE

More information

MPC-816ファミリ

MPC-816ファミリ ACCEL Last update May 25,2005 (MPC-684F) MPC-684 MPC-684 1 MPC-684...5 MPC-684...6...7...7...7...8 USB-RS (...10... 11 I/O...12...12 I/O...12...14...14...14...14...15...16...17 LIST...17...18...18...19...20...20...21...21...21

More information

RQT7440-5S

RQT7440-5S -5S DEMO DEMO DEMO OFF v ! () () q w8 e AM ANT P- AM ANT FM ANT 75 R AUX L L R HIGH 6 LOW 6 q w L R AC HIGH (6 Ω) HIGH L LOW R 4 GOODBYE q POWER w EJECT DEMO CHECK HI-SPEED AUTO DOWN LIST SELECT UP PUSH

More information

tebiki00.dvi

tebiki00.dvi (Linux) [ UNIX ] CMD Workshop ( ) 1 *********************************************************************** * Linux PC-UNIX UNIX * * 99% FreeBSD BSD PC-UNIX * * * ***********************************************************************

More information

P03.ppt

P03.ppt (2) Switch case 5 1 1 2 1 list0317.c if /*/ intnum; printf(""); scanf("%d", &num); 2 if (num % 3 == 0) puts( 0"); else if (num % 3 == 1) puts(" 1"); else puts( 32"); 3 if list0318.c /*/ intnum; printf("");

More information

CX-G6400 ユーザーズガイド

CX-G6400 ユーザーズガイド CX-G6400 CANON FINETECH INC. 2017 4Y1-8609-020 1 1 2 2 2 2 3 1. 5 / 5 6 7 8 10 11 USB 12 LAN 13 / 14 14 15 16 2. 32 35 35 36 3. 38 38 39 40 41 43 48 50 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75

More information

Microsoft PowerPoint - InfPro_I6.pptx

Microsoft PowerPoint - InfPro_I6.pptx 今日の学習内容 ファイルとディレクトリ ( 続 )(pp.34-36) 色々なUNIXのコマンド (pp.203-209) 今日の基礎教養セミナ講演会 Yahooの坂本さん 3コマ (13:10~) A204 ディレクトリ ( 復習 ) UNIXファイルシステムにはファイルとディレクトリがあり ツリー状の階層型構造をしている ツリー構造の頂点 ( ツリー構造の根の部分 ) 一番上の唯一のディレクトリをルートディレクトリと呼ぶ

More information

C言語によるアルゴリズムとデータ構造

C言語によるアルゴリズムとデータ構造 Algorithms and Data Structures in C 4 algorithm List - /* */ #include List - int main(void) { int a, b, c; int max; /* */ Ÿ 3Ÿ 2Ÿ 3 printf(""); printf(""); printf(""); scanf("%d", &a); scanf("%d",

More information

DEMO OFF v a

DEMO OFF v a -S DEMO OFF v a 5 () 6 () 7 q w8 e \ EXT LOOP AM ANT EXT LOOP AM ANT a FM ANT P- AUX a L R 8 a q w L R HIGH (6 Ω) HIGH L LOW R 9 % % q q # 8! ; @ @9 ;!5! ;! WMA MP HighMAT TUNED ST MONO EQ RE-MASTER

More information

CLOCK/ AUTO OFF TIMER SLEEP DISPLAY DISC ABC DEF TITLE SEARCH GHI JKL MNO TITLE IN CHARA PQRS TUV WXYZ AREA ENTER PROGRAM SPACE! # D

CLOCK/ AUTO OFF TIMER SLEEP DISPLAY DISC ABC DEF TITLE SEARCH GHI JKL MNO TITLE IN CHARA PQRS TUV WXYZ AREA ENTER PROGRAM SPACE! # D CLOCK/ AUTO OFF TIMER SLEEP DISPLAY DISC ABC DEF 2 3 TITLE SEARCH GHI JKL MNO 4 5 6 TITLE IN CHARA PQRS TUV WXYZ 7 8 9 PROGRAM SPACE! # DEL 0 7 REC LEVEL VOL 3 4 VOL z PLAY/ REC LIGHT ALBUM/GROUP INTRO

More information

Microsoft PowerPoint - Borland C++ Compilerの使用方法(v1.1).ppt [互換モード]

Microsoft PowerPoint - Borland C++ Compilerの使用方法(v1.1).ppt [互換モード] Borland C++ Compiler の 使用方法 解説書 (v1.1) 1 準備 (1/2) 1. スタートメニューから コントロールパネル を開いて その中に デスクトップのカスタマイズ フォルダーオプション があるので開く エクスプローラー内の ツール フォルダーオプション などからも開ける 2. 表示 タブにある 登録されている拡張子は表示しない のチェックを外して OKを押す これでファイルの拡張子が表示されるようになった

More information

nakao

nakao Fortran+Python 4 Fortran, 2018 12 12 !2 Python!3 Python 2018 IEEE spectrum https://spectrum.ieee.org/static/interactive-the-top-programming-languages-2018!4 Python print("hello World!") if x == 10: print

More information

help gem gem gem my help

help gem gem gem my help hikiutils 1234 2017 3 1 1 6 1.0.1 help gem................... 7 gem.................................... 7 gem................................... 7 my help.................................. 7 my help......................

More information

Excel97関数編

Excel97関数編 Excel97 SUM Microsoft Excel 97... 1... 1... 1... 2... 3... 3... 4... 5... 6... 6... 7 SUM... 8... 11 Microsoft Excel 97 AVERAGE MIN MAX SUM IF 2 RANK TODAY ROUND COUNT INT VLOOKUP 1/15 Excel A B C A B

More information

or a 3-1a (0 b ) : max: a b a > b result a result b ( ) result Python : def max(a, b): if a > b: result = a else: result = b ret

or a 3-1a (0 b ) : max: a b a > b result a result b ( ) result Python : def max(a, b): if a > b: result = a else: result = b ret 4 2018.10.18 or 1 1.1 3-1a 3-1a (0 b ) : max: a b a > b result a result b result Python : def max(a, b): if a > b: result = a result = b return(result) : max2: a b result a b > result result b result 1

More information

I #2 : ( 8-13), () URL : j inoue/prog2007/prog2007.html

I #2 : ( 8-13), () URL :  j inoue/prog2007/prog2007.html Title 計算機プログラミング I 同演習講義ノート 2007 Author(s) 井上, 純一 Citation Issue Date 2007-08-22T04:23:05Z DOI Doc URLhttp://hdl.handle.net/2115/28047 Right Type learningobject Additional There are other files related

More information

2.4.7 \ AWK AWK......

2.4.7 \ AWK AWK...... AWK [email protected] 2001 1 8 ( ): 1 2002 10 10 ( ): 1.1 AWK C Java AWK perl, ruby web AWK A4 A4 1 ( :p) 2 1 AWK 2 2 AWK 4 2.1 AWK............................... 5 2.2 AWK NR NF.....................................

More information

1st-session key

1st-session key 1 2013/11/29 Project based Learning: Soccer Agent Program 1 2012/12/9 Project based Learning: Soccer Agent Program PBL Learning by doing Schedule 1,2 2013 11/29 Make 2013 12/6 2013 12/13 2013 12/20 2014

More information

Numerical Rosetta Stone 1 C, Java, Perl, Ruby, Python [ ] Hello world C: /* hello.c $> gcc hello.c $>./a.out */ #include <stdio.h> main(){ printf("hel

Numerical Rosetta Stone 1 C, Java, Perl, Ruby, Python [ ] Hello world C: /* hello.c $> gcc hello.c $>./a.out */ #include <stdio.h> main(){ printf(hel Numerical Rosetta Stone 1 C, Java, Perl, Ruby, Python [ ] Hello world C: /* hello.c $> gcc hello.c $>./a.out */ #include main(){ printf("hello world of C!\n"); Java: // hello.java $> javac hello.java

More information

本 日 の 授 業 内 容 最 低 限 覚 えるべきUNIXコマンド pwd, ls, mkdir, cd, cp, rm, mv テキストエディタの 簡 単 な 使 い 方 テキストエディット, Jedit X,Emacs C 言 語 プログラミングの 初 歩 hello, world を 画 面

本 日 の 授 業 内 容 最 低 限 覚 えるべきUNIXコマンド pwd, ls, mkdir, cd, cp, rm, mv テキストエディタの 簡 単 な 使 い 方 テキストエディット, Jedit X,Emacs C 言 語 プログラミングの 初 歩 hello, world を 画 面 情 報 処 理 技 法 (Cプログラミング)I 第 2 回 ー UNIXの 基 本 (2) C 言 語 の 初 歩 ー 担 当 : 荻 田 武 史 本 日 の 授 業 内 容 最 低 限 覚 えるべきUNIXコマンド pwd, ls, mkdir, cd, cp, rm, mv テキストエディタの 簡 単 な 使 い 方 テキストエディット, Jedit X,Emacs C 言 語 プログラミングの

More information

Express5800/340Hb-Rユーザーズガイド(セットアップ編)

Express5800/340Hb-Rユーザーズガイド(セットアップ編) 4 B 1 2 Phoenix BIOS Setup Utility Main Advanced Stratus Security Boot Exit System Time : System Date : Primary Master Primary Slave [15:23:34] [01/30/2004] CD-ROM ATRPI Removable Item Specific Help

More information