Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Prog1_WS2017_18_Wienkop
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Uwe Wienkop
Prog1_WS2017_18_Wienkop
Commits
7239ba35
Commit
7239ba35
authored
Nov 27, 2017
by
Uwe Wienkop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Klassen vor Einführung Konstruktor
parent
ef6f04e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
17 deletions
+22
-17
Prog1_WS2017-18/06GameOfLife_Console/Program.cs
Prog1_WS2017-18/06GameOfLife_Console/Program.cs
+16
-16
Prog1_WS2017-18/07IntroKlassen/Program.cs
Prog1_WS2017-18/07IntroKlassen/Program.cs
+6
-1
No files found.
Prog1_WS2017-18/06GameOfLife_Console/Program.cs
View file @
7239ba35
...
...
@@ -21,9 +21,9 @@ namespace _06GameOfLife_Console
Console
.
Clear
();
// Elemente zeilenweise ausgeben:
for
(
int
i
=
0
;
i
<
gen
.
GetLength
(
0
);
i
++)
for
(
int
i
=
0
;
i
<
gen
.
GetLength
(
0
);
i
++)
// GetLength(0) = Anz. Zeilen
{
for
(
int
j
=
0
;
j
<
gen
.
GetLength
(
1
);
j
++)
for
(
int
j
=
0
;
j
<
gen
.
GetLength
(
1
);
j
++)
// GetLength(1) = Anz. Spalten
{
if
(
gen
[
i
,
j
])
// Entspricht: gen[i,j]==true?)
Console
.
Write
(
"#"
);
...
...
@@ -87,16 +87,16 @@ namespace _06GameOfLife_Console
/// </summary>
/// <param name="generation">aktuelle Generation</param>
/// <returns>neues Feld, enthält die ermittelten Werte</returns>
//
static int[,] AnzahlNachbarn(bool[,] generation)
//
{
// // anzN = neues int[,]
Feld, gleiche Größe wie der Parameter "generation"
static
int
[,]
AnzahlNachbarn
(
bool
[,]
generation
)
{
int
[,]
anzN
=
new
int
[
feldgroesse
,
feldgroesse
];
//
Feld, gleiche Größe wie der Parameter "generation"
//
// Für jedes Element in generation:
//
// falls Element lebendig
//
// Nachbarn in anzN erhöhen ... siehe Aufgabenstellung!
// Für jedes Element in generation:
// falls Element lebendig
// Nachbarn in anzN erhöhen ... siehe Aufgabenstellung!
// //
return anzN;
//
}
return
anzN
;
}
...
...
@@ -104,13 +104,13 @@ namespace _06GameOfLife_Console
/// Evolutionsschritt gemäß Conways Regeln
/// </summary>
/// <param name="generation">aktuelle Generation; wird durch die Funktion verändert</param>
//static void Evolution(bool[,] generation)
//{
// int[,] anzN = AnzahlNachbarn(generation);
static
void
Evolution
(
bool
[,]
generation
)
{
int
[,]
anzN
=
AnzahlNachbarn
(
generation
);
// Your Code here
}
// // Your Code here
//}
static
void
Main
(
string
[]
args
)
{
// Startmuster:
...
...
Prog1_WS2017-18/07IntroKlassen/Program.cs
View file @
7239ba35
...
...
@@ -9,7 +9,11 @@ namespace _07IntroKlassen
class
Person
{
public
string
Name
,
Vorname
,
Anschrift
;
public
/* static */
void
Ausgeben
()
//public static void Ausgeben(Person p)
//{
// Console.WriteLine($"{p.Vorname} {p.Name}");
//}
public
void
Ausgeben
()
{
Console
.
WriteLine
(
$"
{
Vorname
}
{
Name
}
"
);
}
...
...
@@ -33,6 +37,7 @@ namespace _07IntroKlassen
berta
.
Ausgeben
();
foreach
(
Person
p
in
pfeld
)
{
//Person.Ausgeben(p);
p
.
Ausgeben
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment