====== CS106A BouncingBall Sample Code Phenomenon - Ball bounces forever? ======
This is the "BouncingBall" Sample Code for [[http://see.stanford.edu/see/cour... turned out to show some STRANGE PHENOMENON. The ball seems not to come to rest. In fact, at the end yo
auszuführen. In unserem Beispiel müssen wir diese allerdings durch kompilieren erst noch selbst erzeuge... eben dem Compiler auch gleich noch eine JRE, also alle Komponenten um unser Java Programm später ausfüh... ann benötigt wenn auf dem Zielsystem kein SDK installiert wurde und wir bereits Byte Code, also *.class... Java Source Code? =====
Das ist im einfachsten Fall (unserem) nicht sehr schwer.
- öffnen Sie ein
rKarel {
public void run() {
// 1st column is allways at starting point
while( frontIsClear() ) {... irColumn() {
/* Climbs a Columne and fixes it. Falls back down when done.
* facing EAST again.
... ) {
putBeeper();
}
turnAround();
moveToWall();
turnLeft();
}
private void moveToWall() {
// Moves Karel all the way straight forward until
stops. The world may be of any size, but you are allowed to
* assume that it is at least as tall as it is wide.
*/
import stanford.karel.*;
public clas... Karel at 1,1 facing EAST
* no Beepers at all
*
* Post-condition: Karel at 1,1 facing EA... Karel at 1:1 facing EAST
* no Beepers at all
* Post-condition: Karel infront of RIGHT WALL
facing EAST
*/
turnLeft();
move();
pickAllBeepers();
turnAround();
move();
turnLeft();... facing EAST
*/
turnRight();
move();
pickAllBeepers();
turnAround();
move();
turnRight();
}
private void pickAllBeepers() {
/* This Method picks up ALL Beepers at Karels actual position
*/
while( beepersPrese
* Since this is the FIRST VALUE it is also the smallest
* AND the largest entry so far i put it
... );
}
println( "Thanks!\n" );
println( "Smallest Number entered is: " + min );
println( "Lar
- Draw Lines
*
* Write a GraphicsProgram that allows the user to
* draw lines on the canvas. Pres... ed by some elastic string, this
* technique is called rubber-banding.
* Although this program may s