From 08bf0717388a69a8350197708a7aaa56df23b127 Mon Sep 17 00:00:00 2001 From: Nico Foss <nicolste@stud.ntnu.no> Date: Mon, 26 Aug 2024 11:06:12 +0200 Subject: [PATCH] week1 --- pset1/mario.c | 28 ++++++++++++++++++++++++++++ pset1/mario2.c | 26 ++++++++++++++++++++++++++ pset1/uppercase.py | 3 +++ 3 files changed, 57 insertions(+) create mode 100644 pset1/mario.c create mode 100644 pset1/mario2.c create mode 100644 pset1/uppercase.py diff --git a/pset1/mario.c b/pset1/mario.c new file mode 100644 index 0000000..ea9ff90 --- /dev/null +++ b/pset1/mario.c @@ -0,0 +1,28 @@ +#include <stdio.h> +#include <cs50.h> + +int main(void) +{ + int n; + + do + { + n = get_int("size: "); + } + + while(n < 1); + + + + for(int i = 0; i < n; i++) + { + for(int j = 0; j < n; j++) + { + printf("#"); + } + + printf("\n"); + + } + +} \ No newline at end of file diff --git a/pset1/mario2.c b/pset1/mario2.c new file mode 100644 index 0000000..d5ec5c0 --- /dev/null +++ b/pset1/mario2.c @@ -0,0 +1,26 @@ +#include <cs50.h> +#include <stdio.h> + + +int main(void) +{ + //get size + int n = get_size(); + + + //make grid + print_grid(n); +} + +int get_size(void) +{ + int n; + + do + { + int n = get_int("size: "); + } + + while (n < 1); + return n; +} \ No newline at end of file diff --git a/pset1/uppercase.py b/pset1/uppercase.py new file mode 100644 index 0000000..9d68fa2 --- /dev/null +++ b/pset1/uppercase.py @@ -0,0 +1,3 @@ +before = input("before: ") +print("After ", end="") +print(before.upper()) -- GitLab