Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "random_crossplattform_von_roman.h"
- #include "gotoxy.h"
- #include "wait.h"
- void wuerfel(const int p_startx, const int p_starty, const int p_viereck);
- void eins(const int p_startx, const int p_starty, const int p_viereck);
- void zwei(const int p_startx, const int p_starty, const int p_viereck);
- void drei(const int p_startx, const int p_starty, const int p_viereck);
- void vier(const int p_startx, const int p_starty, const int p_viereck);
- void fuenf(const int p_startx, const int p_starty, const int p_viereck);
- void sechs(const int p_startx, const int p_starty, const int p_viereck);
- void punkt(int viereck);
- int* randomwuerfel(int p_startx, int p_starty, int p_viereck);
- void wuerfeln1(int p_startx, int p_starty, int p_viereck);
- int main()
- {
- gen_seed();
- int startx = 3;
- int starty = 1;
- const int viereck = 219;
- int randomnumber = get_randint(1, 6);
- wuerfeln1(startx, starty, viereck);
- gotoxy(startx +50, starty + 50);
- printf("%i", randomwuerfel(startx, starty, viereck)[0]);
- gotoxy(startx + 10, starty + 21);
- printf("%i", randomwuerfel(startx, starty, viereck)[1]);
- gotoxy(startx + 10, starty + 22);
- printf("%i", randomwuerfel(startx, starty, viereck)[2]);
- gotoxy(startx + 10, starty + 23);
- printf("%i", randomwuerfel(startx, starty, viereck)[3]);
- gotoxy(startx + 10, starty + 24);
- printf("%i", randomwuerfel(startx, starty, viereck)[4]);
- gotoxy(startx + 10, starty + 25);
- printf("%i", randomwuerfel(startx, starty, viereck)[5]);
- return 0;
- }
- void wuerfel(const int p_startx, const int p_starty, const int p_viereck)
- {
- int wert = 0;
- //oben
- for (int i = 0; i < 22; i++)
- {
- gotoxy(p_startx + wert, p_starty);
- printf("%c", p_viereck);
- wert++;
- }
- wert = 0;
- //unten
- for (int i = 0; i < 22; i++)
- {
- gotoxy(p_startx + wert, p_starty + 10);
- printf("%c", p_viereck);
- wert++;
- }
- wert = 0;
- //links
- for (int i = 0; i < 11; i++)
- {
- gotoxy(p_startx, p_starty + wert);
- printf("%c", p_viereck);
- wert++;
- }
- wert = 0;
- //links2
- for (int i = 0; i < 11; i++)
- {
- gotoxy(p_startx + 1, p_starty + wert);
- printf("%c", p_viereck);
- wert++;
- }
- wert = 0;
- //rechts
- for (int i = 0; i < 11; i++)
- {
- gotoxy(p_startx + 20, p_starty + wert);
- printf("%c", p_viereck);
- wert++;
- }
- wert = 0;
- //rechts2
- for (int i = 0; i < 11; i++)
- {
- gotoxy(p_startx + 21, p_starty + wert);
- printf("%c", p_viereck);
- wert++;
- }
- wert = 0;
- }
- void eins(const int p_startx, const int p_starty, const int p_viereck)
- {
- wuerfel(p_startx, p_starty, p_viereck);
- gotoxy(p_startx + 10, p_starty + 5);
- punkt(p_viereck);
- gotoxy(p_startx + 20, p_starty + 10);
- }
- void zwei(const int p_startx, const int p_starty, const int p_viereck)
- {
- wuerfel(p_startx, p_starty, p_viereck);
- gotoxy(p_startx + 8, p_starty + 6);
- punkt(p_viereck);
- gotoxy(p_startx + 12, p_starty + 4);
- punkt(p_viereck);
- gotoxy(p_startx + 20, p_starty + 10);
- }
- void drei(const int p_startx, const int p_starty, const int p_viereck)
- {
- wuerfel(p_startx, p_starty, p_viereck);
- gotoxy(p_startx + 10, p_starty + 5);
- punkt(p_viereck);
- gotoxy(p_startx + 6, p_starty + 3);
- punkt(p_viereck);
- gotoxy(p_startx + 14, p_starty + 7);
- punkt(p_viereck);
- gotoxy(p_startx + 20, p_starty + 10);
- }
- void vier(const int p_startx, const int p_starty, const int p_viereck)
- {
- wuerfel(p_startx, p_starty, p_viereck);
- gotoxy(p_startx + 6, p_starty + 3);
- punkt(p_viereck);
- gotoxy(p_startx + 14, p_starty + 3);
- punkt(p_viereck);
- gotoxy(p_startx + 6, p_starty + 7);
- punkt(p_viereck);
- gotoxy(p_startx + 14, p_starty + 7);
- punkt(p_viereck);
- gotoxy(p_startx + 20, p_starty + 10);
- }
- void fuenf(const int p_startx, const int p_starty, const int p_viereck)
- {
- wuerfel(p_startx, p_starty, p_viereck);
- gotoxy(p_startx + 10, p_starty + 5);
- punkt(p_viereck);
- gotoxy(p_startx + 6, p_starty + 3);
- punkt(p_viereck);
- gotoxy(p_startx + 14, p_starty + 3);
- punkt(p_viereck);
- gotoxy(p_startx + 6, p_starty + 7);
- punkt(p_viereck);
- gotoxy(p_startx + 14, p_starty + 7);
- punkt(p_viereck);
- gotoxy(p_startx + 20, p_starty + 10);
- }
- void sechs(const int p_startx, const int p_starty, const int p_viereck)
- {
- wuerfel(p_startx, p_starty, p_viereck);
- gotoxy(p_startx + 6, p_starty + 3);
- punkt(p_viereck);
- gotoxy(p_startx + 14, p_starty + 3);
- punkt(p_viereck);
- gotoxy(p_startx + 6, p_starty + 5);
- punkt(p_viereck);
- gotoxy(p_startx + 14, p_starty + 5);
- punkt(p_viereck);
- gotoxy(p_startx + 6, p_starty + 7);
- punkt(p_viereck);
- gotoxy(p_startx + 14, p_starty + 7);
- punkt(p_viereck);
- gotoxy(p_startx + 20, p_starty + 10);
- }
- void punkt(int p_viereck)
- {
- printf("%c%c", p_viereck, p_viereck);
- }
- int* randomwuerfel(int p_startx, int p_starty, int p_viereck)
- {
- int augenzahl[6] = { 0, 0, 0, 0, 0 };
- int randomnumber = get_randfloat(1, 6);
- if (randomnumber == 1)
- {
- eins(p_startx, p_starty, p_viereck);
- augenzahl[0] = randomnumber;
- }
- if (randomnumber == 2)
- {
- zwei(p_startx, p_starty, p_viereck);
- augenzahl[1] = randomnumber;
- }
- if (randomnumber == 3)
- {
- drei(p_startx, p_starty, p_viereck);
- augenzahl[2] = randomnumber;
- }
- if (randomnumber == 4)
- {
- vier(p_startx, p_starty, p_viereck);
- augenzahl[3] = randomnumber;
- }
- if (randomnumber == 5)
- {
- fuenf(p_startx, p_starty, p_viereck);
- augenzahl[4] = randomnumber;
- }
- if (randomnumber == 6)
- {
- sechs(p_startx, p_starty, p_viereck);
- augenzahl[5] = randomnumber;
- }
- return augenzahl;
- }
- void wuerfeln1(int p_startx, int p_starty, int p_viereck)
- {
- randomwuerfel(p_startx, p_starty, p_viereck);
- p_startx = p_startx + 23;
- randomwuerfel(p_startx, p_starty, p_viereck);
- p_startx = p_startx + 23;
- randomwuerfel(p_startx, p_starty, p_viereck);
- p_startx = p_startx + 23;
- randomwuerfel(p_startx, p_starty, p_viereck);
- p_startx = p_startx + 23;
- randomwuerfel(p_startx, p_starty, p_viereck);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement