-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_putsquare.c
31 lines (28 loc) · 1.17 KB
/
ft_putsquare.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_putsquare.c :+: :+: */
/* +:+ */
/* By: ravan-de <[email protected]> +#+ */
/* +#+ */
/* Created: 2019/05/31 18:54:51 by ravan-de #+# #+# */
/* Updated: 2019/06/13 12:33:42 by ravan-de ######## odam.nl */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putsquare(unsigned short square)
{
int i;
i = 0;
while (i < 16)
{
if ((unsigned short)(((unsigned short)1 << i) & square) == (unsigned short)1 << i)
ft_putchar('#');
else
ft_putchar('.');
if ((i + 1) % 4 == 0)
ft_putchar('\n');
i++;
}
ft_putendl("");
}