美文网首页开源软件实验室IT课程分享IT小白
这8首用代码写的诗歌,看懂3首就是大神!

这8首用代码写的诗歌,看懂3首就是大神!

作者: 蓝桥云课 | 来源:发表于2019-03-14 09:55 被阅读62次

    用代码写诗,是一个程序员“装逼”的最高形式。下面这8首诗,看看大家能读懂几首呢?

    01 未竟的爱

      class love {};
    
      void main()
    
      {
    
         throw love();
    
      }
    

    02 导入灵魂

      # This scirpt should save lifes.
    
      import soul
    
      for days in len(life):
    
        print “happiness”
    

    03 一见钟情

      // Love at first sight
    
      if (me.getDistanceTo(you.position) < 200) {
    
         me.setFeelings({
    
              inLove: true,
    
        });
    
      }
    

    04 双面人

      public class TwoFaced {
    
    public String greet() {
    
        return "Hi! So great to see you!";
    
    }
    
        private String think() {
    
        return "Fucking bitch.";
    
    }
    
      }
    

    05 期待搁浅

      private Boolean she_smiles_for_me() {
    
         //heart:
    
         while(true) {
    
       System.out.printIn(”beat.”);
    
       try {
    
          Thread.sleep(86400000)
    
       } catch (InterruptedException e) {}
    
          }
    
    return true;
    
      }
    

    06 舞动的心

      using System;
        
      public class PoemCode
      {
         private bool dancing_within()
         {
            Boolean me = true;
      while (dancing_within())
      {
         var iables_of_light = "";
         try { int elligently_to;
         object ify_the_world_apart; }
         catch (Exception s)
         {
            int o_the_broken_parts;
            throw; int o_the_seed_of_life;
         }
    
         Random ashes_of = new Random();
         float ing_devices;
         short age_of;
         char acter_will_never_let_you = 'b';
      }
      return me;
         }
      }
    

    07 那叫生活

      package together.
    
      the. sun.
    
      and. the. summer.
    
      that. moon.
    
      and. all. stars.
    
      and. those. cool. crazy. cars.
    
      and. the. sky.
    
      its. amazing.
    
      and. all. my. kids. laughing. waving.
    
      call. it. life.
    
      oh. i. wish.
    
      it. just. werent. 
    
      a. lie;
    

    08 日常琐事

      import java.util.Date;
    
      public class DailyGrind {
    
         public static final void main(String[] args) {
    
      boolean its_time_to_go_home = false;
      boolean away_the_hours = true;
    
      while (away_the_hours) {
      boolean away_the_hours = true;
    
      Date now = new Date();
      its_time_to_go_home = now.getHours() > 17
      && now.getMinutes() > 30;
    
         if (its_time_to_go_home) {
            break;
      }
    
      try {
            Thread.sleep(60000);
      } catch (InterruptedException e) {
            // ignore
      }
    }
        }
      }
    

    怎么样?你看懂了几首呢?欢迎大家留言噢。

    其实,Code Poetry代码诗歌在国外已经是一种被学者们认可的诗歌创作形式,并且有程序员都出自己的诗集了。

    代码诗歌有两种,一种是代码书写,人可以直接读懂。另一种是代码书写,机器会转化为有趣的声音,图像等。

    相关推荐

    50个Python练手项目,拿去过冬吧!

    10个不到500行代码的超牛Python练手项目

    10个精彩Python视频教程整理,10种新技能轻松Get!

    30本Python学习参考书,从入门到大师全了!

    大牛推荐的10本学习Java必看书

    如何开始使用Java机器学习

    再别说找不到C++练手项目,这20个拿去不谢!

    image

    相关文章

      网友评论

        本文标题:这8首用代码写的诗歌,看懂3首就是大神!

        本文链接:https://www.haomeiwen.com/subject/cjgfmqtx.html