summaryrefslogtreecommitdiff
path: root/rush/max_search_x_trial.c
diff options
context:
space:
mode:
Diffstat (limited to 'rush/max_search_x_trial.c')
-rw-r--r--rush/max_search_x_trial.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/rush/max_search_x_trial.c b/rush/max_search_x_trial.c
new file mode 100644
index 0000000..84d51c2
--- /dev/null
+++ b/rush/max_search_x_trial.c
@@ -0,0 +1,69 @@
+#include <unistd.h>
+
+void change_to_max(int x[4], int l, int r)
+{
+ int i;
+ i = 0;
+ while (i < 4)
+ {
+ if (i >= (l - 1) && i <= (4 - r))
+ x[i] = 4;
+ i++;
+ }
+}
+
+void change_to_max2(int *y)
+{
+
+ *y = 4;
+
+}
+
+void ft_putchar(char c)
+{
+ write(1, &c ,1);
+}
+
+int main(void)
+{
+ int matrix[4][4] = {{0}};
+
+ // int a;
+ // a = 0;
+ // {
+ // change_to_max(matrix[a], 2, 2);
+ // a++;
+ // }`
+
+ int b;
+ b = 0;
+
+ int t;
+ int u;
+
+ t = 2;
+ u = 2;
+
+ while (b < 4)
+ {
+ if (b >= (t - 1) && b <= (4 - u))
+ change_to_max2(&matrix[b][0]);
+ b++;
+ }
+
+ int i;
+ int j;
+
+ i = 0;
+ while (i <= 3)
+ {
+ j = 0;
+ while (j <= 3)
+ {
+ ft_putchar(matrix[i][j] + '0');
+ j++;
+ }
+ ft_putchar(0x0a);
+ i++;
+ }
+} \ No newline at end of file