16
PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

Embed Size (px)

Citation preview

Page 1: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

PROGRAMMIEREN DESCASIO FX-7400GII

Von Benjamin Altmayer

Page 2: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

Gliederung• Was ist ein Programm?• Syntax des GTR• Eingaben (?)• Ausgaben (Text)• Übungen (Rechnen mit Variablen)

Eventuell: (1)• Textdisplay (Locate)• Übung: (Getkeyanzeige)• Übung: (Laufender Ball)

Eventuell (2): (Ohne Powerpoint)• Grafikdisplay (Draw)• Übung (Kreise und Linien)• Spiel: Thron(Snacke)

Page 3: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

Was ist ein Programm?

Page 4: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

Was ist ein Programm ?

• Software• Folge von Anweisungen in einer

Programmiersprache

Code -> Programmiersprache -> Maschinencode

Page 5: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

Syntax des GTR

Page 6: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

Syntax des GTRNur 28 Variablen (A-Z + 2 Sonderzeichen)Variablen können nur Zahlen beinhaltenVariablen setzen: 100->A (Pfeil über AC/ON)Übertragen in andere Varaible: A->B

Programmiermenü: SHIFT -> VARS -> COMAllgemein Beispiel

0->A

If [] If A=1

Then Then

[] Locate 1,1,“Richtig!“

Else Else

[] Locate 1,1,“Falsch!“

IfEnd IfEnd

Page 7: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

Syntax des GTR

While-Befehle brauchen kein „Then“

Allgemein Beispiel

0->A

While [] While A < 300

[] A+1->A

WhileEnd WhileEnd

Page 8: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

Eingaben

Benutzereingabe einer Variable mit ?->[]Einfügen eines Fragetextes ist möglich„Anzahl:“?->Z

Beispiel„Anzahl:“?->Z

Z*2->Z

Locate 1,1,Z

Page 9: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

ÜBUNGZAHLENRECHNER

Schreibe ein Programm, welches eine Zahl vom Benutzer abfrägt und zu ihr 100 addiert

Beispiel

?->Z

100+Z->Z

Locate 1,1,Z

Page 10: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

ÜBUNGNOTENRECHNER

Schreibe ein Programm, welches den Durchschnitt vom Benutzer eingegebener Zahlen ausrechnet.

Beispiel

0->N

„Anzahl:“?->A

A->B

While B =nicht 0

ClrText

„Note:“?->M

M+N->N

B-1->B

WhileEnd

N/A->A

ClrText

Locate 1,1,“Durchschnitt:“

Locate 13,1,A

Page 11: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

Zufallsgenerator

OPTN -> PROB -> RAND -> Int

RanInt#(A = MINB = MAXRanInt#(A,B)

Beispiel

RanInt#(1,6)->A

A=3

RanInt#(1,6)

A=6

RanInt(1,6)

A=1

Page 12: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

Eingaben

Knopfdrücke:Jeder Knopf hat eineeigene NummerGetkey->[] (I/O -> Gtky)

(Wenn kein Knopf gedrückt: Getkey = 0)

BeispielWhile 1=1

ClrText

Getkey->A

If A=31

Then

Locate 1,1,“EXE“

Else

Locate 1,1,“Nicht EXE“IfEnd

WhileEnd

Page 13: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

ÜBUNGTASTER

Schreibe ein Programm, um die gerade gedückte Taste auf dem Dsiplay auszugeben

2.Beispiel

While 1=1

0->W

While W<100

W+1->W

WhileEnd

While Getkey=0

Getkey

WhileEnd

Getkey->K

Lokate 10,5,K

WhileEnd

1.Beispiel

While 1=1

Getkey->A

Locate 1,1,A

WhileEnd

Page 14: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

Textdisplay

Locate (I/O -> Lcte)Locate X,Y,Z

Textdisplay:X = 21 ZeichenY = 7 Zeilen (Eigentlich 8)

Beispiel100 -> E

Locate 1,1,“Ergebnis:“

Locate 11,1,A

Page 15: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

ÜBUNGBALL

Lasse mithilfe von Getkey und Locate einen Ball über den Bildschirm laufen

If K=28

Then

Y-1->Y

IfEnd

If K=37

Then

Y+1->Y

IfEnd

Locate X,Y,“@“

O->W

While W<50

W+1->W

WhileEnd

WhileEnd

Beispiel

7->X

5->Y

While 1=1

Getkey->K

If K=38

Then

X-1->X

IfEnd

If K=27

Then

X+1->X

IfEnd

Verbesserung

Y=8=>7->Y

Y=0=>1->Y

X=22=>21->X

X=0=>1->X

Page 16: PROGRAMMIEREN DES CASIO FX-7400GII Von Benjamin Altmayer

Danke für eure Aufmerksamkeit!