Code Hunt 刷题记录

本文介绍了CodeHunt这个编程游戏的初步体验,玩家通过补全C#代码解决谜题。文章分享了前两个章节的游戏过程及代码示例,适合编程初学者练习。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Code Hunt 是微软研究院推出的一个教育类编程游戏站点。游戏玩家,也称为“代码猎人”,
可选择 Java 或 C# 编程语言,需要必须在游戏发现补上缺失的代码片段。
放假无聊在家做了两个chapter,语言选的C#,纯属娱乐:)

00.01

帮你熟悉使用Code Hunt平台的基本操作

00.02

public class Program {
    public static int Puzzle(int x) {
        return x+1;
    }
}

00.03

public class Program {
    public static int Puzzle(int x) {
        return x*2;
    }
}

00.04

public class Program {
    public static int Puzzle(int x, int y) {
        return x+y;
    }
}

01.01

public class Program {
    public static int Puzzle(int x) {
        return -x;
    }
}

01.02

public class Program {
    public static int Puzzle(int x) {
        return x-2;
    }
}

01.03

public class Program {
    public static int Puzzle(int x) {
        return x*x;
    }
}

这道题用计算器一算(1089/33)等于33就找出规律了。

01.04

public class Program {
    public static int Puzzle(int x) {
        return x*3;
    }
}

01.05

public class Program {
    public static int Puzzle(int x) {
        return x/3;
    }
}

上一道是乘3,这一道是除以3,这样的上下联系在后面还会出现...

01.06

public class Program {
    public static int Puzzle(int x) {
        return 4/x;
    }
}

01.07

public class Program {
    public static int Puzzle(int x, int y) {
        return x-y;
    }
}

01.08

public class Program {
    public static int Puzzle(int x, int y) { 
        return x+2*y;
    }
}

01.09

public class Program {
    public static int Puzzle(int x, int y) {
        return x*y;
    }
}

01.10

public class Program {
    public static int Puzzle(int x, int y) {
        return x+y/3;
    }
}

这一道思考的时间长一些

01.11

public class Program {
    public static int Puzzle(int x, int y) { 
        return x/y;
    }
}

01.12

public class Program {
    public static int Puzzle(int x) {
        return x%3;
    }
}

01.13

public class Program {
    public static int Puzzle(int x) {
        return x%3+1;
    }
}

唔...在上一道的基础上联想加一

01.14

public class Program {
    public static int Puzzle(int x) {
        return 10%x;
    }
}

01.15

public class Program {
    public static int Puzzle(int x, int y, int z) {
        return (x+y+z)/3;
    }
}

看数据非常自然的联想倒平均数

可以看出前两章都非常容易,准备抽空闲时间再试试后面的。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值