Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
Functions Solutions
Functions Dersi Problem Çözümleri
-
import std.stdio; void printMenu(string[] items, int firstNumber) { foreach (i, item; items) { writeln(' ', i + firstNumber, ' ', item); } } void main() { string[] items = [ "Black", "Red", "Green", "Blue", "White" ]; printMenu(items, 1); }
- Here are some ideas:
- Write a function named
drawHorizontalLine()
to draw horizontal lines. - Write a function named
drawSquare()
to draw squares. This function could take advantage ofdrawVerticalLine()
anddrawHorizontalLine()
when drawing the square. - Improve the functions to also take the character that is used when "drawing". This would allow drawing each shape with a different character:
void putDot(Canvas canvas, int line, int column, dchar dot) { canvas[line][column] = dot; }
- Write a function named
Copyright © 1999-2025 by the D Language Foundation | Page generated by
Ddoc on Sun Aug 24 07:18:00 2025