Tags:
tag this topic
create new tag
view all tags
Algorithm for placing one item
This algorithm should be sent the 2D array and one item.
Assume there there is space available
Start with the 0'th ship
While there is space, you have not placed the item, and you have not checked every ship
Start with the 0'th container on the current ship
While it is not placed and you have not checked every container on the current ship
If there is room
place it
indicate that you found where to place it
otherwise go to the next container
if need be go to the next ship
if never placed that means there was no room
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
R
aw View
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r2 - 2024-03-05
-
CathyBareiss
Home
Site map
Assessment web
BethelAIResources2026 web
CenterForComputing web
ChatGPT web
Intro2AIatBethel web
Main web
Sandbox web
TWiki web
CenterForComputing Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
E
dit
A
ttach
Copyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback