Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 17 Sep 2014, 09:59
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
Methods of drawing a tic tac toe board
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
xmf-149

Joined: 02 Aug 2013
Posts: 17

PostPosted: Sat 24 Aug 2013, 14:33    Post subject:  Methods of drawing a tic tac toe board  

description:a sample script to draw a tic tac toe board.post other ones on this thread
Code:
#!/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

_________________
Exclamation Exclamation Exclamation
Back to top
View user's profile Send private message 
darkcity


Joined: 23 May 2010
Posts: 2452
Location: near here

PostPosted: Sat 24 Aug 2013, 14:45    Post subject:  

Interesting you are writing the file a byte at a time?
_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0431s ][ Queries: 11 (0.0079s) ][ GZIP on ]