Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,2 @@
awk -f fizzbuzzGenerate.awk input.txt > fizzbuzzCustom.awk
awk -f fizzbuzzCustom.awk numbers.txt

View file

@ -0,0 +1,33 @@
# usage: awk -f fizzbuzzGen.awk > fizzbuzzCustom.awk
#
function Print(s) {
print s > "/dev/stderr"
}
BEGIN { Print( "# FizzBuzz-Generate:" )
q2 = "\""
fN = "numbers.txt"
#fP = "fizzbuzzCustom.awk"
}
NF==1 { Print( "# " $1 " Numbers:" )
for( i=1; i <= $1; i++ )
print( i ) > fN # (!!) write to file not allowed in sandbox at ideone.com
Print( "# Custom program:" )
print "BEGIN {print " q2 "# CustomFizzBuzz:" q2 "} \n"
next
}
NF==2 { Print( "# " $1 "-->" $2 ) ##
print "$1 % "$1" == 0 {x = x "q2 $2 q2 "}"
next
}
END { print ""
print "!x {print $1; next}"
print " {print " q2 " " q2 ", x; x=" q2 q2 "} \n"
print "END {print " q2 "# Done." q2 "}"
Print( "# Done." )
}