i wanted to write c again and i found this folder on my computer
i rearranged some shit and started actually making 3xplus1.c i consider 3xplus1.c to be complete (maybe) and there is also hello.c that is complete @quantum teach me c pl0xpl0xpl0xpl0xpl0xpl0xpl0xpl0xpl0xpl0xpl0x
This commit is contained in:
parent
f45049a2fe
commit
0fe2d7cf14
7 changed files with 5696 additions and 13 deletions
19
3x+1andfriends.c
Normal file
19
3x+1andfriends.c
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
char *libz_atoi(char *dicks);
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
char *dicks = "!123";
|
||||||
|
long x = 76;
|
||||||
|
|
||||||
|
while(x != 1) {
|
||||||
|
if(x % 2 == 0) {
|
||||||
|
x /= 2;
|
||||||
|
}
|
||||||
|
else {x = (x * 3) + 1;}
|
||||||
|
printf("%ld\n", x);
|
||||||
|
}
|
||||||
|
printf("%s\n", dicks);
|
||||||
|
char *dick2 = libz_atoi(dicks);
|
||||||
|
printf("%d\n", dick2);
|
||||||
|
return 0;
|
||||||
|
}
|
21
3xplus1.c
Normal file
21
3xplus1.c
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#include <stdio.h> //printf and shit
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
//asd
|
||||||
|
int x; //idk what types are i think this is a 32bit signed int... idk @quantum help... also should this even be here or should it be out of main
|
||||||
|
x = 69;
|
||||||
|
while(x != 1){ //while x is not true i think
|
||||||
|
printf("%d\n",x );
|
||||||
|
if(x & 1 == 1){ //if x is odd
|
||||||
|
x = (3 * x) + 1;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
x = x / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
puts("number reaches one");
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
a.out
BIN
a.out
Binary file not shown.
17
hello.c
17
hello.c
|
@ -1,15 +1,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h> //printf and shit
|
||||||
|
|
||||||
int main() {
|
int main(){
|
||||||
long x = 76;
|
printf("asd");
|
||||||
|
return 0;
|
||||||
while(x != 1) {
|
|
||||||
if(x % 2 == 0) {
|
|
||||||
x /= 2;
|
|
||||||
}
|
|
||||||
else {x = (x * 3) + 1;}
|
|
||||||
printf("%ld\n", x);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
BIN
jame/src/olcExampleProgram
Executable file
BIN
jame/src/olcExampleProgram
Executable file
Binary file not shown.
49
jame/src/olcExampleProgram.cpp
Normal file
49
jame/src/olcExampleProgram.cpp
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
#define OLC_PGE_APPLICATION
|
||||||
|
#include "olcPixelGameEngine.h"
|
||||||
|
#include <time.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
class Example : public olc::PixelGameEngine
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Example()
|
||||||
|
{
|
||||||
|
sAppName = "Example";
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool OnUserCreate() override
|
||||||
|
{
|
||||||
|
// Called once at the start, so create things here
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OnUserUpdate(float fElapsedTime) override
|
||||||
|
{
|
||||||
|
// called once per frame
|
||||||
|
for (int x = 0; x < ScreenWidth(); x++)
|
||||||
|
for (int y = 0; y < ScreenHeight(); y++) {
|
||||||
|
|
||||||
|
float idkwhy = fElapsedTime;
|
||||||
|
idkwhy = idkwhy * 0x40000000;
|
||||||
|
int cuck = (int)idkwhy;
|
||||||
|
|
||||||
|
if (cuck % 2){
|
||||||
|
Draw(x, y, olc::Pixel(cuck % 255, 69, 5));
|
||||||
|
printf("%d\n", cuck);
|
||||||
|
}
|
||||||
|
else{Draw(x, y, olc::Pixel(5, 5, 5));}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
Example demo;
|
||||||
|
if (demo.Construct(256, 240, 4, 4))
|
||||||
|
demo.Start();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
5603
jame/src/olcPixelGameEngine.h
Normal file
5603
jame/src/olcPixelGameEngine.h
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue