Methods of drawing a tic tac toe board

A home for all kinds of Puppy related projects
Post Reply
Message
Author
xmf-149
Posts: 23
Joined: Fri 02 Aug 2013, 04:00

Methods of drawing a tic tac toe board

#1 Post by xmf-149 »

description:a sample script to draw a tic tac toe board.post other ones on this thread

Code: Select all

#!/bin/sh
c=50;w=$[$[c+1]*3+1]
row=$(yes 00$(yes C0|head -$c|tr -d '\n')|head -$[$w/$[$c+1]]|tr -d '\n')$(yes 00|head -$[$w%$[$c+1]]|tr -d '\n')$(yes 11|head -$[(4-$w%4)%4]|tr -d '\n')
hr=$(echo $row|sed s_.._00_g)$'\n'
r=50;h=$[$[r+1]*3+1]
TMP=$(yes $hr$(yes $row|head -$r)|head -$[$h/$[$r+1]])$'\n'$(yes $hr|head -$[$h%$[$r+1]])
TMP=$(echo 'obase=16;ibase=16;for(i=0;i<=F;i++){print 0,i,0,i,0,i,0,0};for(i=10;i<=FF;i++){print i,i,i,0,0;}'|bc|tr -d '\\\n')$TMP
TMP=0100-0800-00000000-00000000-00000000-00000000-00010000-00010000$TMP
TMP=$(printf %08X $w|grep -o ..|tac|tr -d '\n')$(printf %08X $h|grep -o ..|tac|tr -d '\n')$TMP
TMP=00000000-00000000-36040000-28000000$TMP
TMP=$(echo $TMP|tr -d ' -'|sed 's_.._\\x&_g')
printf BM$TMP>file.bmp
mtpaint file.bmp
:!: :!: :!:

User avatar
darkcity
Posts: 2534
Joined: Sun 23 May 2010, 19:16
Location: near here
Contact:

#2 Post by darkcity »

Interesting you are writing the file a byte at a time?

Post Reply