Forums - Open Redstone Engineers

Full Version: C Goodies
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Malcolmforde

I was being a derp and invented a very derpy command system in C. It only accepts numbers as commands and derps if you enter anything other than a number :3
And yes, I am very new to C. Don't blab at me.

Screenshot:
[Image: 6mtj2ge.png]

And the source code: https://dl.dropboxusercontent.com/u/59183206/Command.c

Oh yes, I will also be using this for a text adventure.
#include<stdio.h>
#include<stdlib.h>
int main(void){
float B2;
float B;
int E;
printf("Enter the base: ");
scanf("%f", &B);
printf("Enter the exponent: ");
scanf("%d", &E);
if (E==0 && B!=0){
printf("The result is: 1 ");
}
else if (E==0 && B==0){
printf("The result is: Indeterminate ");
}
B2=B;
while(E!=1){
E=E-1;
B=B*B2;
}
printf("The result is: %f",B);
getch();
}

Malcolmforde

(05-24-2013, 08:05 AM)mad1231999 Wrote: [ -> ]https://github.com/Mads-Clausen/TextEditor

STOP ADVERTISING YOU ASSHAT
Type ""0""

What is this sorcery?

Malcolmforde

(05-25-2013, 08:28 AM)mad1231999 Wrote: [ -> ]Type ""0""

What is this sorcery?

I was testin crap