PageMac
Home
   dot Projects
   dot Pics and Images
   dot WREK
D++
   dot About / FAQ
   dot Download
   dot Code Library
   dot Documentation
   dot VB6 Runtime Files
About

  Source Code - dpp/source/stars.dpp

Download link (right click, save as)



1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
title "Stars";
newvar stars;
newvar spaces;
newvar rows;
newvar cols;

newvar x;
newvar y;

screenput "Please enter width: ";
screenin stars; screen;

if isnumeric(stars) = False then
 screenput "Please enter a number!";
 finish;
endif

if stars < 1 then
 screenput "Please enter a number!";
 finish;
endif

cols = stars;
spaces = 0;
screen;

for rows = 0 to stars;
 screen;
 for x = 0 to spaces;
  screenput " ";
 next x;
 for y = 0 to cols;
  screenput "* ";
 next y;
 spaces++;
 cols--;
next rows;

cols = 1;
spaces = spaces - 2;

for rows = 0 to stars - 1;
 screen;
 for x = 0 to spaces;
  screenput " ";
 next x;
 for y = 0 to cols;
  screenput "* ";
 next y;
 spaces--;
 cols++;
next rows;ò

This code is Copyright (C) 2000-2012 PageMac Programming. Reproduction of this code must adhere to the GNU General Public License.