The GridWorld case study provides a graphical environment in which students can experiment with different types of objects and observe how programming changes will affect the behavior of those objects. It is a required part of the AP Computer Science curriculum. (Computer Science A students are expected to be familiar with the material in Parts 1-4 of the case study narrative, while AB (discontinued) students are required to be familiar with all 5 parts.)
Questions tagged [gridworld]
84 questions
17
votes
11 answers
Programming coordinates-based game, like dots or checkers
I'm looking to learn some fundamentals on cartesian geometry or coordinates based game programming. Platform is irrelevant, although I'm most proficient in JavaScript, C, Objective-C. Ultimately being able to create something such as dots or…

Coocoo4Cocoa
- 48,756
- 50
- 150
- 175
6
votes
1 answer
Setting the color of an object
I am using GridWorld in my AP Computer Science class, and part of what we are doing is changing the color of the bug (an object). I have found a very basic way to do this but am trying to incorporate strings to allow the user to type in what color…

Mitch Stallings
- 65
- 1
- 5
4
votes
4 answers
How do I throw and catch an IllegalArgumentException?
So basically I have a GridWorld Project that I'm doing right now in my AP Comp Sci class. I'm doing Pacman. Here is my code for the act method (for those unfamiliar with GridWorld, the act method is called every time an actor is expected to make a…

Max Bastian
- 43
- 1
- 1
- 3
2
votes
1 answer
(GridWorld) World's setGrid() not repainting properly?
I'm trying to use GridWorld (from the AP computer science curriculum) for making a game, and I'm having problems with using multiple grids. World's setGrid method doesn't seem to work. I was under the impression that you could have multiple grid…

Pojo
- 1,229
- 4
- 16
- 26
2
votes
0 answers
Implementing Sarsa(lambda) - Gridworld - in Julia language
Could you explain me what is wrong in this code ? I am trying to implement SARSA(lamda) with eligibility traces.
using ReinforcementLearningBase, GridWorlds
using PyPlot
world = GridWorlds.GridRoomsDirectedModule.GridRoomsDirected();
env =…

przel123
- 21
- 1
2
votes
2 answers
Q Learning Grid World Scenario
I'm researching GridWorld from Q-learning Perspective. I have issues regarding the following question:
1) In the grid-world example, rewards are positive for goals, negative
for running into the edge of the world, and zero the rest of the time.
…

trivikram srinivas
- 29
- 2
2
votes
1 answer
My scanner/terminal window stops functioning after one repeat
I am currently working on a tower defense project on gridworld (not sure if that is significant). I have a timer that calls a method (TowerPlacer) from my main class to receive user text input via scanner. However, after the first time through,…

George Ng
- 23
- 2
2
votes
1 answer
How to move a Bug in GridWorld with arrow keys
I'm making a game for my computer Science class and I am trying to move a character object that extends Bug with the arrow keys. Should I put the code to move with the arrow keys in the Character class or in the World class? And what should the…

Dustin Weinmann
- 21
- 1
- 2
2
votes
1 answer
Extending one class in the GUI in GridWorld without changing others that use it
I want to change the DefaultDisplay class of the GridWorld GUI so I can change the image of an actor during a run, and since I am using a jar file of the code I am creating a subclass CustomDisplay of DefaultDisplay.
However, since creating a…

i .
- 485
- 2
- 10
- 23
1
vote
1 answer
GridWorld Lab Problems
I am attempting to create a code that will move an actor to a random location if it is open. However, I am having difficulties with an error that results from this line.
if (null == get(loc))
Basically I thought this line would check if the…

Ernie S
- 131
- 1
- 2
- 10
1
vote
0 answers
How to generate a unique id and send response mail as subject line in google form
Team,
can you help me with a script or solution for google form to generate unique ID with customization id i.e. CSMTO-0001 after each submission of google form and send responded email subject line with same unique id

Sunil Joseph
- 21
- 1
1
vote
1 answer
Python native gridworld implementation (no NumPy)
I've implemented gridworld example from the book Reinforcement Learning - An Introduction, second edition" from Richard S. Sutton and Andrew G. Barto, Chapter 4, sections 4.1 and 4.2, page 80.
Here is my…

OzrenTkalcecKrznaric
- 5,535
- 4
- 34
- 57
1
vote
1 answer
Procedural world generation can't handle big maps
so, I'm making a terraria-like game in unity 2019 on windws 10 using c# which has procedurally generated tilemaps and i have this script attached to a grid:
using UnityEngine;
using AccidentalNoise;
using System.Collections.Generic;
using…

TryingMyBest
- 63
- 10
1
vote
1 answer
Cannot find symbol symbol: method process(WorkerAnt)
I am doing this AntFarm project for my Java class. This project consists of different classes(Food, WorkerAnt, Queen) and they interact with each other using a interface(with a method called…

Joe
- 13
- 3
1
vote
4 answers
Would it be acceptable to place bounds around my pathfinding area?
I'm currently using the A* pathfinding algorithm to calculate a path on an infinite grid (using an UnboundedGrid in Gridworld, the AP CS case study, if that helps anyone). Everything works wonderfully, except for cases where no valid path exists…

Lewis
- 1,310
- 1
- 15
- 28