10-07-2006
format problem
hey everyone, Im making a program that prints different patterns using *
like this:
*
***
*****
*******
*****
***
*
i am letting the user decide what the number of rows can be, i want the shape to appear on the left (60 spaces from the right) if it is even and on the right if they choose an odd number. Any suggestions on how to get them to print in that format?
thanks
Last edited by bebop1111116; 10-08-2006 at 01:28 AM..
10 More Discussions You Might Find Interesting
1. Programming
Hi, there. Everyone had a great Thanksgiving?
I have a slice format problem when I am using vim to edit c++ source code. I don't know how to discribe the problem exactly. You see, usually when I use the command "vi hello.cpp" to write a code, it will have the format like this:
#include... (4 Replies)
Discussion started by: HOUSCOUS
4 Replies
2. UNIX for Dummies Questions & Answers
Hello guyz..
just want to know whether my doubt can be solve or not..maybe it
my company using yyyymmddxx for serial no format..and it cause problems..
first, my adjustments for moving n deleting domain name exceeded xxx per day, and it will cause and effect the yyyymmdd digits.
can... (6 Replies)
Discussion started by: unknown2205
6 Replies
3. Shell Programming and Scripting
studentNo=$1
tmp=/tmp/acc2courses$ID.$$
grep -w "$studentNo" CSE1001 >/dev/null 2>&1
&& echo CSE1001 >>$tmp
grep -w "$studentNo" CSE1002 >/dev/null 2>&1
&& echo CSE1002 >>$tmp
grep -w "$studentNo" CSE9001 >/dev/null 2>&1
&& echo CSE9001 >>$tmp
This is my code,
The output in tmp file... (10 Replies)
Discussion started by: ccwq
10 Replies
4. Shell Programming and Scripting
i need to send 2 diff mail in a single script:Below the script
#!/bin/ksh
echo "enter the number"
read num
if
then
mail -s "test" unix@yahoo.com
mail -s "test" 9886767000@nma.vodafone.in,9916138003@nma.vodafone.in
else
echo "test again"
fi... (5 Replies)
Discussion started by: ali560045
5 Replies
5. Shell Programming and Scripting
Someone can help for the following fromat change can done by script?
i.e. insert the perivous colurm's first variable if below line don't have the varaible start from AXXX....
From
A123,B123,C123
B123,C123
A234,B234,C234
A345,B345,C345
B345,C34
B345,C345
B345,C345
A456,B456,C456
... (2 Replies)
Discussion started by: bleach8578
2 Replies
6. Shell Programming and Scripting
if ( $opt{ww} ) {
my $week = $opt{ww} ? $opt{ww} : $lot_list->{cal}->getWW();
print "\nStarting at $week\n";
while ( $week > 200430 ) {
print localtime() . ": Working on $week\n";
my ($start,$end) = $lot_list->getWeekDates($week);
print localtime() . ":... (3 Replies)
Discussion started by: vahnski
3 Replies
7. Shell Programming and Scripting
can any one know that how can i get perfect format of phone number
my function is
phone_number=`echo $name_number | awk '{print $NF}'`
check=`echo $phone_number | egrep -c "--"`
i get the format but if i need perfect format like xxx-xxx-xxxx. if i enter not in this format it still... (1 Reply)
Discussion started by: tarunsavalia
1 Replies
8. Shell Programming and Scripting
Hello Everyone!
I hope you can help me!!
I have this little problem:
I executed oracle query and the output of the result are in a text file called "DATAFILE.txt", and the value of file is: 97.37
Well, the script compare the result in text file with a condition:
... (5 Replies)
Discussion started by: bobbasystem
5 Replies
9. Shell Programming and Scripting
Hi
I have a shell scribt with some numbers in exponential format, for example, "1.23456789E +01" Now I would like to bring these numbers into a format without the E. Can someone help me
Thanks
Flo
---------- Post updated at 10:07 AM ---------- Previous update was at 09:14 AM... (1 Reply)
Discussion started by: sbfly
1 Replies
10. Shell Programming and Scripting
I have written a code in Linux environment which compares two dates and print "correct" if 1st date is less than 2nd date. But when I'm running the same code in SunOS environment, "date -d is an illegal format" is the error it is throwing. How different should my code be so that it executes well in... (18 Replies)
Discussion started by: Chandan_Bose
18 Replies
LEARN ABOUT X11R4
xkbcomputeshapetop
XkbComputeShapeTop(3) XKB FUNCTIONS XkbComputeShapeTop(3)
NAME
XkbComputeShapeTop - Determines the bounding box of the top surface of a shape
SYNOPSIS
Bool XkbComputeShapeTop ( shape, bounds_rtrn )
XkbShapePtr shape;
XkbBoundsPtr bounds_rtrn;
ARGUMENTS
- shape
shape to be examined
- bounds_rtrn
backfilled with the bounding box for the shape
DESCRIPTION
Xkb provides a number of convenience functions to help use a keyboard geometry. These include functions to return the bounding box of a
shape's top surface and to update the bounding box of a shape row or section.
A shape is made up of a number of outlines. Each outline is a polygon made up of a number of points. The bounding box of a shape is a rec-
tangle that contains all the outlines of that shape.
XkbComputeShapeTop returns a BoundsRec that contains two x and y coordinates. These coordinates describe the corners of a rectangle that
contains the outline that describes the top surface of the shape. The top surface is defined to be the approximating outline if the approx
field of shape is not NULL. If approx is NULL, the top surface is defined as the last outline in the shape's array of outlines. XkbCom-
puteShapeTop returns False if shape is NULL or if there are no outlines for the shape; otherwise, it returns True.
STRUCTURES
typedef struct _XkbBounds {
short x1,y1; /* upper left corner of the bounds, in mm/10 */
short x2,y2; /* lower right corner of the bounds, in mm/10 */
} XkbBoundsRec, *XkbBoundsPtr;
X Version 11 libX11 1.2.1 XkbComputeShapeTop(3)