圣诞树后能找到我的记忆


大家请忽略这篇文章的发表时间委屈,毕竟今年的圣诞节还很遥远……


---------------------------下 面 是 正 文-----------------------------

  • 当雪花飘落,寒风吹起,才发觉,浪漫的圣诞已经飘然而至,这一刻什么都可以忘记,唯独不能忘记的是向好朋友你们说声天冷了,注意身体,圣诞快乐! 

  •  这颗树上能掉下礼物么?我一直在等......一直在等, 千 与 梦 随。。。 

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define PI 3.14159265359
#define T px+se*r*cosf(ta),py+se*r*sin(ta)
float sx, sy;
float scc(float px, float py, float r)
{
    float dx = px - sx, dy = py - sy;
    return sqrtf(dx * dx + dy * dy) - r;
}
float wpn(float d1, float d2)
{
    return d1<d2?d1:d2;
}
float f(float px, float py, float ta, float se, int n)
{
    float d = 0.0f;
    for (float r = 0.0f; r < 0.8f; r += 0.02f)
        d=wpn(d,scc(T,0.05f*se*(0.95f-r)));
    if (n > 0) for (int t = -1; t <= 1; t += 2)
        {
            float tt = ta + t * 1.8f,ss = se * 0.9f;
            for (float r = 0.2f; r < 0.8f; r += 0.1f)
                d = wpn(d, f(T, tt, ss * 0.5f, n - 1)),ss*= 0.8f;
        }
    return d;
}
int panduan()
{
    float x = (fmodf(sy, 0.1f) / 0.1f - 0.5f) * 0.5f;
    return sx >=x -0.05f&&sx<=x+0.05f;
}
int main(int arc, char* arv[])
{
    int n =arc>1?atoi(arv[1]):3;
    float arr=arc>2?atof(arv[2]):1.0f;
    for (sy=0.8f; sy>0.0f; sy-=0.02f/arr,putchar('
'))
        for (sx = -0.35f; sx < 0.35f; sx += 0.01f / arr)
            if (f(0, 0, PI * 0.5f, 1.0f, n) < 0.0f)
            {
                if (sy < 0.1f) putchar('.');
                else
                {
                    if (panduan()) putchar('=');
                    else putchar("............................#j&o"[rand() % 32]);
                }
            }
            else putchar(' ');
    return 0;
}


迷失在幽谷中的鸟儿,独自飞翔在这偌大的天地间,却不知自己该飞往何方……



原文地址:https://www.cnblogs.com/im0qianqian/p/5989555.html