Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Some Codescape Solutions
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christoph Król
Some Codescape Solutions
Commits
20e0f23c
Commit
20e0f23c
authored
3 years ago
by
Christoph Król
Browse files
Options
Downloads
Patches
Plain Diff
Added Deck 4
parent
ba14ba4f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Deck 4/Der Universalschlüssel.java
+46
-0
46 additions, 0 deletions
Deck 4/Der Universalschlüssel.java
Deck 4/Der rechte Weg.java
+48
-0
48 additions, 0 deletions
Deck 4/Der rechte Weg.java
Deck 4/Tabalugas Vermächtnis.java
+40
-0
40 additions, 0 deletions
Deck 4/Tabalugas Vermächtnis.java
with
134 additions
and
0 deletions
Deck 4/Der Universalschlüssel.java
0 → 100644
+
46
−
0
View file @
20e0f23c
import
codescape.Dogbot
;
public
class
MyDogbot
extends
Dogbot
{
/**
* Der Funktion run() wird ein Paramter überreicht
* @param keys Array mit Passwort-Strings für die vier Konsolen
*/
public
void
run
(
String
[]
keys
)
{
// Dein Code hier:
/* Zahlen:
* 0 -> move();
* 1 -> turnLeft();
* 2 -> turnRight();
*/
moves
(
"0001"
);
write
(
keys
[
0
]);
moves
(
"2001"
);
write
(
keys
[
1
]);
moves
(
"2002000202"
);
write
(
keys
[
2
]);
moves
(
"1002"
);
write
(
keys
[
3
]);
moves
(
"10000"
);
}
void
moves
(
String
steps
){
String
moves
=
steps
;
for
(
int
i
=
0
;
i
<
moves
.
length
();
i
++){
char
step
=
moves
.
charAt
(
i
);
switch
(
step
){
case
'0'
:
move
();
break
;
case
'1'
:
turnLeft
();
break
;
case
'2'
:
turnRight
();
break
;
case
'3'
:
pickUp
();
break
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Deck 4/Der rechte Weg.java
0 → 100644
+
48
−
0
View file @
20e0f23c
import
codescape.Dogbot
;
public
class
MyDogbot
extends
Dogbot
{
/**
* Der Funktion run() wird ein Paramter überreicht,
* der zum Lösen des Raums benötigt wird.
* @param nr Nummer des Teleporters, der zum Ausgang führt
*/
public
void
run
(
int
nr
)
{
// Dein Code hier:
System
.
out
.
print
(
nr
);
switch
(
nr
)
{
case
1
:
moves
(
"00100020010022030"
);
break
;
case
2
:
moves
(
"001000200200030"
);
case
3
:
moves
(
"00200010010022030"
);
case
4
:
moves
(
"002000100200030"
);
}
}
void
moves
(
String
steps
){
String
moves
=
steps
;
for
(
int
i
=
0
;
i
<
moves
.
length
();
i
++){
char
step
=
moves
.
charAt
(
i
);
switch
(
step
){
case
'0'
:
move
();
break
;
case
'1'
:
turnLeft
();
break
;
case
'2'
:
turnRight
();
break
;
case
'3'
:
pickUp
();
break
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Deck 4/Tabalugas Vermächtnis.java
0 → 100644
+
40
−
0
View file @
20e0f23c
import
codescape.Dogbot
;
public
class
MyDogbot
extends
Dogbot
{
public
void
run
()
{
// Einlesen des Strings und Bewegung des RB zum Beginn des Labyrinths
move
();
turnLeft
();
/**
* gelesen wird ein Wort, das aus den Buchstaben "L", "M" und "R" besteht
* getrennt werden die Buchstaben durch ein Komma
* die Variable "weg" könnte so aussehen: "M,L,M,M,R,M"
*/
String
weg
=
read
();
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
turnRight
();
}
String
[]
path
=
weg
.
split
(
","
);
for
(
String
moves
:
path
){
switch
(
moves
){
case
"L"
:
turnLeft
();
break
;
case
"R"
:
turnRight
();
break
;
case
"M"
:
move
();
break
;
}
}
move
();
turnLeft
();
move
();
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment