Commit 27f69001 authored by Dominikus Herzberg's avatar Dominikus Herzberg

Neu generierte HTML nach printf-Fix

parent 71446997
......@@ -890,7 +890,7 @@ number: "0"
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-10-16 17:03:38 Mitteleuropõische Sommerzeit
Last updated 2017-10-16 16:03:38 Mitteleuropõische Sommerzeit
</div>
</div>
</body>
......
......@@ -1953,7 +1953,7 @@ outer: for(int y = 0; y &lt; field.length; y++) {
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-11-07 22:46:33 Mitteleuropõische Zeit
Last updated 2017-11-07 22:51:19 Mitteleuropõische Zeit
</div>
</div>
</body>
......
......@@ -1040,9 +1040,9 @@ int fun(double d, String s) { ... }</pre>
<pre class="CodeRay highlight"><code data-lang="java"><span class="type">void</span> printArray2D(<span class="type">int</span><span class="type">[]</span><span class="type">[]</span> a) {
<span class="keyword">for</span>(<span class="type">int</span> i = <span class="integer">0</span>; i &lt; a.length; i++) {
<span class="keyword">for</span>(<span class="type">int</span> j = <span class="integer">0</span>; j &lt; a[i].length; j++) {
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">%2d </span><span class="delimiter">&quot;</span></span>, a[i][j]);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">%2d </span><span class="delimiter">&quot;</span></span>, a[i][j]);
}
printf(<span class="string"><span class="delimiter">&quot;</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
}
}
......@@ -1077,10 +1077,10 @@ jshell&gt; printArray2D(new int[]{1,2,3,4,5,6,7,8,9}, 3);
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span class="type">void</span> printArray2D(<span class="type">int</span><span class="type">[]</span> a, <span class="type">int</span> w) {
<span class="keyword">for</span>(<span class="type">int</span> i = <span class="integer">0</span>; i &lt; a.length; i++) {
<span class="keyword">if</span>(i &gt; <span class="integer">0</span> &amp;&amp; i % w == <span class="integer">0</span>) printf(<span class="string"><span class="delimiter">&quot;</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">%2d </span><span class="delimiter">&quot;</span></span>, a[i]);
<span class="keyword">if</span>(i &gt; <span class="integer">0</span> &amp;&amp; i % w == <span class="integer">0</span>) <span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">%2d </span><span class="delimiter">&quot;</span></span>, a[i]);
}
printf(<span class="string"><span class="delimiter">&quot;</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
}
<span class="type">int</span><span class="type">[]</span> test = {
......@@ -1290,7 +1290,7 @@ int w6 = r.nextInt(6) + 1;</pre>
<span class="keyword">for</span>(<span class="type">int</span> i = <span class="integer">0</span>; i &lt; n; i++) {
x += rollDoubles();
}
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Durchschnittliche Würfe bis zum Pasch: %.3f</span><span class="delimiter">&quot;</span></span>, <span class="float">1.0</span> * x / n); <span class="comment">// </span><i class="conum" data-value="1"></i><b>(1)</b></code></pre>
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Durchschnittliche Würfe bis zum Pasch: %.3f</span><span class="delimiter">&quot;</span></span>, <span class="float">1.0</span> * x / n); <span class="comment">// </span><i class="conum" data-value="1"></i><b>(1)</b></code></pre>
</div>
</div>
<div class="colist arabic">
......@@ -1967,9 +1967,9 @@ Erweitern Sie Ihr Programm und schreiben Sie eine eigene Ausgabe-Methode <code>v
<pre class="CodeRay highlight"><code data-lang="java"><span class="type">void</span> printP(<span class="type">int</span><span class="type">[]</span><span class="type">[]</span> triangle){
<span class="keyword">for</span>(<span class="type">int</span> n = <span class="integer">0</span>; n &lt; triangle.length; n++){
<span class="keyword">for</span>(<span class="type">int</span> k = <span class="integer">0</span>; k &lt; triangle[n].length; k++){
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">%d </span><span class="delimiter">&quot;</span></span>, triangle[n][k]);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">%d </span><span class="delimiter">&quot;</span></span>, triangle[n][k]);
}
printf(<span class="string"><span class="delimiter">&quot;</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
}
}</code></pre>
</div>
......
......@@ -679,9 +679,9 @@ Sie möchten nun Ihr Programm erweitern und eine ganze Reihe an Flugzeugen flieg
<span class="directive">public</span> <span class="type">void</span> fly(<span class="type">int</span> speed){
<span class="keyword">if</span>(<span class="local-variable">this</span>.maxSpeed &gt;= speed){
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Flugzeug %s fliegt %d mph.</span><span class="delimiter">&quot;</span></span>, <span class="local-variable">this</span>.name, speed);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Flugzeug %s fliegt %d mph.</span><span class="delimiter">&quot;</span></span>, <span class="local-variable">this</span>.name, speed);
} <span class="keyword">else</span>{
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Zu schnell! Flugzeug %s darf nur maximal %d mph fliegen.</span><span class="delimiter">&quot;</span></span>, <span class="local-variable">this</span>.name, <span class="local-variable">this</span>.maxSpeed);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Zu schnell! Flugzeug %s darf nur maximal %d mph fliegen.</span><span class="delimiter">&quot;</span></span>, <span class="local-variable">this</span>.name, <span class="local-variable">this</span>.maxSpeed);
}
}
......@@ -689,7 +689,7 @@ Sie möchten nun Ihr Programm erweitern und eine ganze Reihe an Flugzeugen flieg
<span class="keyword">for</span> (<span class="type">int</span> i = <span class="integer">0</span>; i &lt; planes.length; i++){
<span class="keyword">if</span>(planes[i] != <span class="predefined-constant">null</span>){
planes[i].fly(<span class="integer">1000</span>);
printf(<span class="string"><span class="delimiter">&quot;</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
}
}
}
......@@ -831,7 +831,7 @@ Ein kleiner Tipp: Die Methode <code>answer</code> nutzt die Methode <code>ask</c
test1(), test2(), test3(), test4(), test5()
}
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">%d tests: discovered %d error(s)!</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>,
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">%d tests: discovered %d error(s)!</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>,
test.length,
<span class="predefined-type">Arrays</span>.stream(test).filter(n -&gt; n == <span class="predefined-constant">false</span>).count());</code></pre>
</div>
......@@ -1052,7 +1052,7 @@ $10 ==&gt; 6.666666666666667</pre>
<span class="keyword">new</span> Fraction(<span class="integer">3</span>,<span class="integer">4</span>).div(<span class="keyword">new</span> Fraction(<span class="integer">5</span>,<span class="integer">4</span>)).toString().equals(<span class="string"><span class="delimiter">&quot;</span><span class="content">3/5</span><span class="delimiter">&quot;</span></span>),
}
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">%d tests: discovered %d error(s)!</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>,
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">%d tests: discovered %d error(s)!</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>,
test.length,
<span class="predefined-type">Arrays</span>.stream(test).filter(n -&gt; n == <span class="predefined-constant">false</span>).count());</code></pre>
</div>
......@@ -1372,9 +1372,9 @@ Es ist gar nicht so einfach, einen sinnvollen Algorithmus zum Zeichnen einer Lin
<span class="type">void</span> printImage(<span class="type">char</span><span class="type">[]</span><span class="type">[]</span> image) {
<span class="keyword">for</span>(<span class="type">int</span> y = <span class="integer">0</span>; y &lt; image.length; y++) {
<span class="keyword">for</span>(<span class="type">int</span> x = <span class="integer">0</span>; x &lt; image[y].length; x++) {
printf(<span class="predefined-type">String</span>.valueOf(image[y][x]));
<span class="predefined-type">System</span>.out.printf(<span class="predefined-type">String</span>.valueOf(image[y][x]));
}
printf(<span class="string"><span class="delimiter">&quot;</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
}
}
......@@ -1847,18 +1847,18 @@ Animal<span class="type">[]</span> a = {a0, a1, a2, a3};
<span class="keyword">for</span> (<span class="type">int</span> i = <span class="integer">0</span>; i &lt; a.length; i++){
<span class="keyword">if</span>(a[i] != <span class="predefined-constant">null</span>){
printf (<span class="string"><span class="delimiter">&quot;</span><span class="content">%s </span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, a[i].getIdentity());
<span class="predefined-type">System</span>.out.printf (<span class="string"><span class="delimiter">&quot;</span><span class="content">%s </span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, a[i].getIdentity());
}
}
<span class="keyword">for</span> (<span class="type">int</span> i = <span class="integer">0</span>; i &lt; a.length; i++){
<span class="keyword">if</span>(a[i] != <span class="predefined-constant">null</span>){
printf (<span class="string"><span class="delimiter">&quot;</span><span class="content">%s </span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, a[i].makeSound(i+<span class="integer">1</span>));
<span class="predefined-type">System</span>.out.printf (<span class="string"><span class="delimiter">&quot;</span><span class="content">%s </span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, a[i].makeSound(i+<span class="integer">1</span>));
}
}
printf (<span class="string"><span class="delimiter">&quot;</span><span class="content">Zusammen sind wir %d Jahre alt.</span><span class="delimiter">&quot;</span></span>, Animal.countAllAges(a));</code></pre>
<span class="predefined-type">System</span>.out.printf (<span class="string"><span class="delimiter">&quot;</span><span class="content">Zusammen sind wir %d Jahre alt.</span><span class="delimiter">&quot;</span></span>, Animal.countAllAges(a));</code></pre>
</div>
</div>
</details>
......@@ -1985,34 +1985,34 @@ Unit randomUnitAlive(Unit<span class="type">[]</span> army) {
<span class="type">void</span> printArmy(Unit<span class="type">[]</span> army) {
<span class="keyword">for</span>(Unit u : army) {
<span class="keyword">if</span>(u.number &gt; <span class="integer">0</span>) {
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content"> %3d %10s</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, u.number, u.type);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content"> %3d %10s</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, u.number, u.type);
}
}
}
<span class="type">void</span> simulateBattle(Unit<span class="type">[]</span> blue, Unit<span class="type">[]</span> red) {
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Blau:</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Blau:</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
printArmy(blue);
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Rot:</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Rot:</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
printArmy(red);
<span class="keyword">while</span>(fighterSum(blue) != <span class="integer">0</span> &amp;&amp; fighterSum(red) != <span class="integer">0</span>) {
Unit blueUnit = randomUnitAlive(blue);
Unit redUnit = randomUnitAlive(red);
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">%s gegen %s:</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, blueUnit.toString(<span class="string"><span class="delimiter">&quot;</span><span class="content">blaue</span><span class="delimiter">&quot;</span></span>), redUnit.toString(<span class="string"><span class="delimiter">&quot;</span><span class="content">rote</span><span class="delimiter">&quot;</span></span>));
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">%s gegen %s:</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, blueUnit.toString(<span class="string"><span class="delimiter">&quot;</span><span class="content">blaue</span><span class="delimiter">&quot;</span></span>), redUnit.toString(<span class="string"><span class="delimiter">&quot;</span><span class="content">rote</span><span class="delimiter">&quot;</span></span>));
<span class="type">int</span> kcBlue = blueUnit.killCount(redUnit);
<span class="type">int</span> kcRed = redUnit.killCount(blueUnit);
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content"> %3d %5s %10s sterben</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, kcBlue, <span class="string"><span class="delimiter">&quot;</span><span class="content">rote</span><span class="delimiter">&quot;</span></span>, redUnit.type);
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content"> %3d %5s %10s sterben</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, kcRed, <span class="string"><span class="delimiter">&quot;</span><span class="content">blaue</span><span class="delimiter">&quot;</span></span> , blueUnit.type);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content"> %3d %5s %10s sterben</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, kcBlue, <span class="string"><span class="delimiter">&quot;</span><span class="content">rote</span><span class="delimiter">&quot;</span></span>, redUnit.type);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content"> %3d %5s %10s sterben</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, kcRed, <span class="string"><span class="delimiter">&quot;</span><span class="content">blaue</span><span class="delimiter">&quot;</span></span> , blueUnit.type);
blueUnit.number -= kcRed;
redUnit.number -= kcBlue;
}
<span class="keyword">if</span> (fighterSum(blue) &gt; <span class="integer">0</span>) {
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Blau gewinnt und behält:</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Blau gewinnt und behält:</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
printArmy(blue);
} <span class="keyword">else</span> <span class="keyword">if</span> (fighterSum(red) &gt; <span class="integer">0</span>) {
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Rot gewinnt und behält:</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Rot gewinnt und behält:</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
printArmy(red);
} <span class="keyword">else</span> {
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Alle Einheiten wurden getötet. Es gibt keinen Gewinner.</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Alle Einheiten wurden getötet. Es gibt keinen Gewinner.</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>);
}
}
......
......@@ -755,7 +755,7 @@ false</pre>
<span class="local-variable">this</span>.dur = dur;
}
<span class="type">void</span> play() {
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Playing %s</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, title);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Playing %s</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, title);
}
<span class="type">void</span> setSubtitles(<span class="type">boolean</span> on) {
subtitles = on;
......@@ -776,8 +776,8 @@ false</pre>
<span class="local-variable">this</span>.trackDurations = trackDurations;
}
<span class="type">void</span> play() {
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Playing %s</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, title);
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Current track: %s</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, tracks[currentTrack]);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Playing %s</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, title);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Current track: %s</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, tracks[currentTrack]);
}
<span class="type">void</span> nextTrack() {
currentTrack = (currentTrack + <span class="integer">1</span>) % tracks.length;
......@@ -805,7 +805,7 @@ false</pre>
<span class="local-variable">this</span>.dur = dur;
}
<span class="type">void</span> play() {
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Playing %s</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, title);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Playing %s</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, title);
}
<span class="type">int</span> getDurationSeconds() {
<span class="keyword">return</span> dur;
......@@ -833,7 +833,7 @@ false</pre>
}
<span class="type">void</span> play() {
<span class="local-variable">super</span>.play();
printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Current track: %s</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, tracks[currentTrack]);
<span class="predefined-type">System</span>.out.printf(<span class="string"><span class="delimiter">&quot;</span><span class="content">Current track: %s</span><span class="char">\n</span><span class="delimiter">&quot;</span></span>, tracks[currentTrack]);
}
<span class="type">void</span> nextTrack() {
currentTrack = (currentTrack + <span class="integer">1</span>) % tracks.length;
......
......@@ -781,7 +781,7 @@ summary:after {
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-11-14 22:15:03 Mitteleuropõische Zeit
Last updated 2017-11-20 11:27:41 Mitteleuropõische Zeit
</div>
</div>
</body>
......
......@@ -852,7 +852,7 @@ Die Nutzung von Interfaces zusammen mit der JShell bringt im Moment (build 9-ea+
<span class="keyword">new</span> <span class="predefined-type">Point</span>(<span class="integer">3</span>,<span class="integer">3</span>)
};
<span class="predefined-type">Arrays</span>.sort(points);
printf(<span class="predefined-type">Arrays</span>.toString(points));</code></pre>
Syste.out.printf(<span class="predefined-type">Arrays</span>.toString(points));</code></pre>
</div>
</div>
<div class="colist arabic">
......@@ -873,7 +873,7 @@ printf(<span class="predefined-type">Arrays</span>.toString(points));</code></pr
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-11-10 15:36:13 Mitteleuropõische Zeit
Last updated 2017-11-10 15:39:20 Mitteleuropõische Zeit
</div>
</div>
</body>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment