From 3c2ae5e3880db7eba2f64dff019d569911221c43 Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Sat, 17 Feb 2024 23:57:48 +0000 Subject: Sat, Feb 17, 2024, 3:57 PM -08:00 --- .vscode/settings.json | 5 ++++- wk3/lab/iteration.c | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 wk3/lab/iteration.c diff --git a/.vscode/settings.json b/.vscode/settings.json index bb2ce7a..b4a5b3a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,6 @@ { - "gitdoc.enabled": true + "gitdoc.enabled": true, + "files.associations": { + "string.h": "c" + } } diff --git a/wk3/lab/iteration.c b/wk3/lab/iteration.c new file mode 100644 index 0000000..46a68c9 --- /dev/null +++ b/wk3/lab/iteration.c @@ -0,0 +1,21 @@ +#include +#include +#include +#include +#include + +void draw(int n); + +int main(void) { + int height = get_int("Height: "); + draw(height); +} + +void draw(int n) { + for (int i = 0; i < n; i++) { + for (int j = 0; j < i + 1; j++) { + print("#"); + } + printf("\n"); + } +} -- cgit v1.2.3