I originally pulled this code out of the book to experiment with auto-numeric generation
I have later found an easier way or compromise to the programs original purpose.
But now i am back on just advancing my performance.
For you advanced users this script is simple.
Is there any way i can be educated on how to add columns on the with in the example script listed
such as current characters display at binary placements
#1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,50#
#1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,output,,,,,,,,,, ,,,,,,,50#
#1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, space,,,,,,,,,,,,,,,,,,,,,50#
#1,,,,,,,,,,,,,,,,,,,,,,, colum,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,50#
I am not trying to confuse anyone or myself when i use the word binary just reflecting on the characters physical placement as a numeric switch of a new line tab or space if columns are not allowable.
Code:
#include<stdbool.h>
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#define NUM_SUITS 4
#define NUM_RANKS 13
#define NUM_RAD 9
#define NUM_average 0
int main(void)
{
bool in_hand[NUM_SUITS] [NUM_RANKS] [NUM_RAD] = {false};
bool in_deck[NUM_average] = {false};
int num_cards, rank, rad, suit, average;
const char rank_code[] = {'2','3','4','5','6','7','8','9','t','j','q','k','a'};
const char suit_code[] = {'c','d','h','s'};
const char rad_code[] = {'t','m'};
const char average_code[] = {'y'};
srand((unsigned) time(NULL));
printf("htttp\n");
scanf ("%d", &num_cards);
scanf ("%d", &rad);
printf("c for compressor f forklit g grinder a air tools:");
while (num_cards > 0) {
suit = rand()% NUM_SUITS;
rank = rand()% NUM_RANKS;
rank = rand()% NUM_RAD;
if (!in_hand[suit] [rank] [rad]) {
in_hand[suit] [rank] [rad] = true;
num_cards--;
printf("%c%c", rank_code[rank], suit_code[suit], rad_code[rad]);
while (in_deck > 0) {
suit = rand()% NUM_SUITS;
printf("%c%c", rank_code[rank], suit_code[suit], rad_code[rad]);
printf("average %G\n", average_code, (&num_cards));
}
}
printf("\n");
return 0;
}
}