summaryrefslogtreecommitdiff
path: root/3
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2020-12-03 17:19:04 +0100
committerBond_009 <bond.009@outlook.com>2020-12-03 17:19:04 +0100
commit0f39612c19a4865dcaf5963590b985d4f29c4bd3 (patch)
treedf8e275e97d30cfa5bc6ee947f03c98276868a63 /3
parent3da231113ccdd1b777028a4990dd035d07facdd5 (diff)
Style fixes
Diffstat (limited to '3')
-rw-r--r--3/part1.c4
-rw-r--r--3/part2.c7
2 files changed, 5 insertions, 6 deletions
diff --git a/3/part1.c b/3/part1.c
index c71ce0a..b6d209a 100644
--- a/3/part1.c
+++ b/3/part1.c
@@ -5,9 +5,9 @@
#define INC_RIGHT 3
-int count_trees(const char * filename)
+int count_trees(const char *filename)
{
- FILE * file = fopen(filename, "r");
+ FILE *file = fopen(filename, "r");
// Include space for newline and string terminator
char buffer[64] = { 0 };
diff --git a/3/part2.c b/3/part2.c
index 8bcdcfd..9214c25 100644
--- a/3/part2.c
+++ b/3/part2.c
@@ -3,9 +3,9 @@
#include <stdlib.h>
#include <string.h>
-int count_trees(int inc_right, int inc_down, const char * filename)
+int count_trees(int inc_right, int inc_down, const char *filename)
{
- FILE * file = fopen(filename, "r");
+ FILE *file = fopen(filename, "r");
// Include space for newline and string terminator
char buffer[64] = { 0 };
@@ -17,8 +17,7 @@ int count_trees(int inc_right, int inc_down, const char * filename)
int pos = inc_right;
int hit = 0;
for (int i = 1; fgets(buffer, 64, file); i++) {
- if (inc_down != 1 && i % inc_down != 0)
- {
+ if (inc_down != 1 && i % inc_down != 0) {
continue;
}