(OLD) (ARCHIVED) Puppy Linux Discussion Forum Forum Index (OLD) (ARCHIVED) Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info

This forum can also be accessed as http://oldforum.puppylinux.com
It is now read-only and serves only as archives.

Please register over the NEW forum
https://forum.puppylinux.com
and continue your work there. Thank you.

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 30 Sep 2020, 21:43
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
Methods of drawing a tic tac toe board
Moderators: Flash, JohnMurga
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
xmf-149

Joined: 02 Aug 2013
Posts: 23

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: 2549
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
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]  
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. 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.0538s ][ Queries: 11 (0.0323s) ][ GZIP on ]