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 Thu 18 Dec 2014, 09:36
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 Posts_count  
Author Message
xmf-149

Joined: 02 Aug 2013
Posts: 19

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: 2481
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_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Puppy Projects
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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