LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-21-2003, 12:55 AM   #1
Gerardoj
Member
 
Registered: May 2003
Location: Somewhere over the Rainbow
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465

Rep: Reputation: 30
C. Arrays and Letters?


Hi I'm doing this code. I would like some help to add letter in every square, and that letters form words, I try to make a letters soup. And in the right side I have a Box that I want to add the inserted words, that the user will insert manually. Thanks A lot.

MY CODE:

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>


int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int x, y;
// int a=0;
char msg[80];

/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "");

/* read result of initialization */
errorcode = graphresult();
/* an error occurred */
if (errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
// setbkcolor(9);
/*BIG ARRAY*/
cleardevice();
setlinestyle(0,1,1);
rectangle(100,100,400,400);
line(130,100,130,400);
line(160,100,160,400);
line(190,100,190,400);
line(220,100,220,400);
line(250,100,250,400);
line(280,100,280,400);
line(310,100,310,400);
line(340,100,340,400);
line(370,100,370,400);
line(100,130,400,130);
line(100,160,400,160);
line(100,190,400,190);
line(100,220,400,220);
line(100,250,400,250);
line(100,280,400,280);
line(100,310,400,310);
line(100,340,400,340);
line(100,370,400,370);

/*Letters Square*/
gotoxy(54,3);
printf("Find words");
rectangle(450,200,550,50);
/*cudra se soluciones*/

gotoxy(54,15);
printf("Found words");
rectangle(450,400,550,250);

setcolor(14);
settextstyle(GOTHIC_FONT, HORIZ_DIR, 4);
sprintf(msg, "Letters Soup", 4);
outtextxy(10, 2, msg);
/* draw the 3-d bar */
// setcolor(5);
// bar3d(50,150, 50,
// 150, 10, 2);

bar3d(40,55,10,37,5,4);
bar3d(100,55,220,37,5,3);
bar3d(300,55,380,37,5,3);
setcolor(1);
settextstyle( GOTHIC_FONT, HORIZ_DIR, 2);
sprintf(msg,"file tools about", 1);
outtextxy(10,30,msg);

y += textheight(msg);
/* clean up */
getch();
closegraph();
return 0;
}
 
Old 09-22-2003, 01:15 AM   #2
Mohsen
Member
 
Registered: Feb 2003
Location: Iran
Distribution: Solaris 10
Posts: 201

Rep: Reputation: 30
I've seen your code in BC.
Well, what you want us is to write the whole code for you, isn't it??
You just put some line()s and rectangles()s in your code. Try to write your program and if you had problems ask here.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
getting greek letters? buffed317 Linux - General 2 09-11-2004 02:43 PM
space between letters nicoc Mandriva 5 09-03-2004 12:32 PM
I'm seeing wierd letters tearinox Linux - General 1 02-26-2004 04:09 AM
Arrays and Letters? Gerardoj Programming 1 09-24-2003 12:25 PM
non english letters bynaar Slackware 8 01-21-2003 12:23 PM


All times are GMT -5. The time now is 01:26 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration