step by step explanation of grace
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
NAME = Sully
|
||||
SRCS = Sully.c
|
||||
CLONE = $(NAME)_kid.c
|
||||
CREATE_CLONE = ./$(NAME) > $(CLONE)
|
||||
CREATE_CLONE = ./$(NAME)
|
||||
|
||||
include ../MakefileCommon
|
||||
|
||||
@@ -12,4 +12,3 @@
|
||||
#define FFT(...) FT(__VA_ARGS__)
|
||||
|
||||
FFT(PRINT)
|
||||
|
||||
|
||||
16
3_Sully/calculate_print.sh
Executable file
16
3_Sully/calculate_print.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# it's important to put the input_string inside single quotes
|
||||
input_string='#include <stdio.h>%[\r]#define PRINT %[\s]%[\r]#define FT(...) int main(){%[\\]%[\r]'
|
||||
|
||||
special_cahracters=$(echo -E "$input_string" | grep -o "%\[..\]")
|
||||
echo $special_cahracters
|
||||
|
||||
# assiocative array : https://www.gnu.org/software/bash/manual/html_node/Arrays.html
|
||||
declare -A instructions
|
||||
instructions["%[\r]"]=10
|
||||
instructions["%[\s]"]="S"
|
||||
instructions["%[\\]"]=92
|
||||
instructions["%[\"]"]=34
|
||||
|
||||
for key
|
||||
Reference in New Issue
Block a user