admin 管理员组

文章数量: 887021


2023年12月25日发(作者:virtualbox interface是什么)

105 scanf("%s",k);106 gets(w); set_Christmastree(k);107 color(3);108 printf("nI want to say:n");109 puts(w);110 printf("Made by zhanduanwanfeng."); }111 return

0;112}6这是效果图:

以下是进阶版,更炫:12345#include #include 6#include 7#include 8#define PI 3.9#define T px + scale * r * cosf(theta), py + scale * r * sin(theta)10float

sx, sy;11float

sdCircle(float

px, float

py, float

r) {12 float

dx = px - sx, dy = py - sy;13 return

sqrtf(dx * dx + dy * dy) - r;}14float

opUnion(float

d1, float

d2) {

15 return

d1 < d2 ? d1 : d2;16}17float

f(float

px, float

py, float

theta, float

scale, int

n) {18 float

d = 0.0f;19 for

(float

r = 0.0f; r < 0.8f; r += 0.02f)20 d = opUnion(d, sdCircle(T, 0.05f * scale * (0.95f - r)));21 if

(n > 0)22 for

(int

t = -1; t <= 1; t += 2) {23 float

tt = theta + t * 1.8f; float

ss = scale * 0.9f;24 for

(float

r = 0.2f; r < 0.8f; r += 0.1f) {25 d = opUnion(d, f(T, tt, ss * 0.5f, n - 1));26 ss *= 0.8f;27 }28 }29 return

d;30}31int

ribbon() {32 float

x = (fmodf(sy, 0.1f) / 0.1f - 0.5f) * 0.5f;33 return

sx >= x - 0.05f && sx <= x + 0.05f;}34int

main(int

argc, char* argv[]) {35 int

n = argc > 1 ? atoi(argv[1]) : 3;36 float

zoom = argc > 2 ? atof(argv[2]) : 1.0f;37 for

(sy = 0.8f; sy > 0.0f; sy -= 0.02f / zoom, putchar('n'))38 for

(sx = -0.35f; sx < 0.35f; sx += 0.01f / zoom) {39 if

(f(0, 0, PI * 0.5f, 1.0f, n) < 0.0f) {40 if

(sy < 0.1f) {41 putchar('.');42 } else

{43 if

(ribbon()) {44 putchar('=');45 } else

{46 putchar("............................#j&o"[rand() % 32]);47 } }48 } else

{49 putchar(' ');50 }51 }52 Sleep(1000); printf("nnn");53 for

(size_t

i = 0; i < 40; i++) {54 putchar(' ');55 }56 //_sleep(5000);57 printf("Merry Christmas, baby~!n");58 Sleep(500); for

(size_t

i = 0; i < 40; i++) {59 putchar(' ');60 }61 printf("Never say die.n");62 Sleep(500);63 for

(size_t

i = 0; i < 40; i++) {64 putchar(' '); }65 printf("2016/12/24, 最爱你的UP主n");66 getchar();67}68697071效果图就不放了,感兴趣可以试试,很炫哦。


本文标签: 感兴趣 不放 试试 效果图