Programming > SOPHIA Milestone > Virginia Tech - CS 1114 MazeRunner.java. (All)

Virginia Tech - CS 1114 MazeRunner.java.

Document Content and Description Below

import sofia.micro.jeroo.*; public class MazeRunner extends Jeroo { //~ Fields ................................................................ //~ Constructor ....................................... ....................... // ---------------------------------------------------------- /** * This method creats a Jeroo that holds 15 flowers */ public MazeRunner() { super(15); } //~ Methods ............................................................... /** * This method calls upon another method while the * the conditions of the maze are not met */ public void myProgram() { while (!allConditions()) { this.navMaze(); } } /** * This method contains all the conditions of the maze * @return if conditions are all true the maze is complete */ public boolean allConditions() { return (this.getWorld().getObjects(Net.class).size() == 0 && this.getWorld().getObjects(Flower.class).size() == 0 && this.getGridX() == 1 && this.getGridY() == 1); } /** * This method is the main navigation for the Jeroo, * it contains instruction for gathering flowers, disabling * traps and moving in the maze */ public void navMaze() { if (this.seesNet(AHEAD)) { this.toss(); } if (this.seesFlower(HERE)) { this.pick(); } if (!this.turnLeft() && !this.hopIfClear()) { this.turn(RIGHT); } /** * This method tells the Jeroo * to turn left whenever it is possible to turn * @return if conditions are true the Jeroo will turn left and hop */ public boolean turnLeft() { if (!this.seesWater(LEFT) && !this.seesNet(LEFT)) { this.turn(LEFT); this.hop(); return (true); } else { return (false); } } /** * This method tells the Jeroo * to hop forward if it is clear * @return if conditions are true the Jeroo will hop forward */ public boolean hopIfClear() { if (!this.seesWater(AHEAD) && !this.seesNet(AHEAD)) { this.hop(); return (true); } else { return (false); [Show More]

Last updated: 1 year ago

Preview 1 out of 2 pages

Reviews( 0 )

Recommended For You

 Religious Studies> SOPHIA Milestone > College of William & Mary - CS 1114 TurtleTest.java (All)

preview
College of William & Mary - CS 1114 TurtleTest.java

College of William & Mary - CS 1114TurtleTest.java import sofia.micro.*; import sofia.util.Random; // ------------------------------------------------------------------------- public class TurtleT...

By QuizMaster , Uploaded: Mar 20, 2021

$9.5

 Religious Studies> SOPHIA Milestone > College of William & Mary - CS 1114 Turtle.java. (All)

preview
College of William & Mary - CS 1114 Turtle.java.

import sofia.micro.*; import sofia.util.Random; */ public class Turtle extends Actor { //~ Fields ................................................................ //~ Constructor ..................

By QuizMaster , Uploaded: Mar 20, 2021

$7

 Religious Studies> SOPHIA Milestone > College of William & Mary - CS 1114 Food.java. (All)

preview
College of William & Mary - CS 1114 Food.java.

import sofia.micro.*; import sofia.util.Random; */ public class Food extends SimpleActor { //~ Constructor ........................................................... // ------------------------...

By QuizMaster , Uploaded: Mar 20, 2021

$5.5

 Programming> SOPHIA Milestone > Virginia Tech - CS 1114 Shark.java (All)

preview
Virginia Tech - CS 1114 Shark.java

import sofia.micro.*; import java.util.List; import java.util.ArrayList; //------------------------------------------------------------------------- /** * A shark that chases and eats sardines....

By QuizMaster , Uploaded: Mar 20, 2021

$5

 Religious Studies> SOPHIA Milestone > APPROACHES TO STUDYING RELIGIONS FINAL MILESTONE (All)

preview
APPROACHES TO STUDYING RELIGIONS FINAL MILESTONE

APPROACHES TO STUDYING RELIGIONS FINAL MILESTONE

By Reviewnurse , Uploaded: Mar 12, 2021

$10

 Statistics> SOPHIA Milestone > Sophia Statistics FINAL Milestone. With RATIONALE and CONCEPT. Score 21/25 (All)

preview
Sophia Statistics FINAL Milestone. With RATIONALE and CONCEPT. Score 21/25

MILESTONE Score 21/25 You passed this Milestone 21 questions were answered correctly. 4 questions were answered incorrectly. 1 This chart shows the number of students of different age groups who...

By QuizMaster , Uploaded: Oct 15, 2020

$11

 Art> SOPHIA Milestone > SOPHIA art history unit 1 milestone,100% CORRECT (All)

preview
SOPHIA art history unit 1 milestone,100% CORRECT

Which of the following is the correct definition of a curator? 2 While artists like Henri Matisse used traditional media, including oil paint on canvas, artists in the later 20th century exp...

By securegrades , Uploaded: Oct 12, 2020

$11

 Social Sciences> SOPHIA Milestone > HUM 111 Sophia Art History 1 Milestone 2. Strayer University – A Grade (All)

preview
HUM 111 Sophia Art History 1 Milestone 2. Strayer University – A Grade

HUM 111 Sophia Art History 1 Milestone 2 {2020} – Strayer University 1 Which of the following best describes this sculpture? • Subject is depicted in the Flavian style • Subject is portr...

By Elli , Uploaded: Jan 07, 2021

$12

 Biology> SOPHIA Milestone > HUMAN BIOLOGY Sophia Learning -Milestone Study Guide Revisions, 17 Updated Study Guide, Correctly Answered Questions, (All)

preview
HUMAN BIOLOGY Sophia Learning -Milestone Study Guide Revisions, 17 Updated Study Guide, Correctly Answered Questions,

Sophia Learning - HUMAN BIOLOGY - Milestone Study Guide Revisions, 17 Updated Study Guide, Correctly Answered Questions, Test bank Questions and Answers with Explanations (latest Update), 100% Correct...

By TopScholar , Uploaded: Feb 01, 2021

$13

 History> SOPHIA Milestone > Introduction to Art History SOPHIA Milestone UNIT 2. Passed this Milestone All questions were answered correctly. SOPHIA Learning (All)

preview
Introduction to Art History SOPHIA Milestone UNIT 2. Passed this Milestone All questions were answered correctly. SOPHIA Learning

ART HISTORY SOPHIA UNIT 2 MILESTONE You passed this Milestone All questions were answered correctly. 1 What keeps the massive dome of the Pantheon from collapsing? ● The use of wood instead of co...

By QuizMaster , Uploaded: Oct 26, 2020

$10

$8.50

Add to cart

Instant download

Can't find what you want? Try our AI powered Search

OR

GET ASSIGNMENT HELP
193
0

Document information


Connected school, study & course



About the document


Uploaded On

Mar 20, 2021

Number of pages

2

Written in

Seller


seller-icon
QuizMaster

Member since 4 years

1085 Documents Sold


Additional information

This document has been written for:

Uploaded

Mar 20, 2021

Downloads

 0

Views

 193

Document Keyword Tags

THE BEST STUDY GUIDES

Avoid resits and achieve higher grades with the best study guides, textbook notes, and class notes written by your fellow students

custom preview

Avoid examination resits

Your fellow students know the appropriate material to use to deliver high quality content. With this great service and assistance from fellow students, you can become well prepared and avoid having to resits exams.

custom preview

Get the best grades

Your fellow student knows the best materials to research on and use. This guarantee you the best grades in your examination. Your fellow students use high quality materials, textbooks and notes to ensure high quality

custom preview

Earn from your notes

Get paid by selling your notes and study materials to other students. Earn alot of cash and help other students in study by providing them with appropriate and high quality study materials.

WHAT STUDENTS SAY ABOUT US


What is Browsegrades

In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Browsegrades · High quality services·