Skip to content

Instantly share code, notes, and snippets.

@hplc
Last active June 19, 2019 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hplc/897718d1f932564dcfc84aba8fe9eaab to your computer and use it in GitHub Desktop.
Save hplc/897718d1f932564dcfc84aba8fe9eaab to your computer and use it in GitHub Desktop.
#!/usr/bin/php
<?php
$terms = [
"RRM的英文全称" => "Radio Resource Management",
"LTE最小调度周期是多长时间" => "1ms",
"LTE支持多种系统带宽,它们是(各带宽间用英文逗号间隔)" => "1.4MHz,3MHz,5MHz,10MHz,15MHz,20MHz",
"RAC的英文全称" => "Radio Admission Control",
"RBC的英文全称" => "Radio Bearer Control",
"DRA的英文全称" => "Dynamic Resource Allocation",
"ICIC的英文全称" => "Inter Cell Interference Coordination",
"LB的英文全称" => "Load Balance",
"CMC的英文全称" => "Connection Mobility Control",
"QoS的英文全称" => "Quality of Service",
"RRM的职责范围包括:无线准入控制、无线承载控制、动态资源调度分配、小区间干扰协调、负责均衡、连接移动性控制、中继和" => "系统间无线资源管理",
"小区间干扰控制技术主要有三种,它们是干扰随机化技术、干扰消除技术和" => "小区间干扰协调技术",
"负载均衡也称为负载控制,本质上是一种话务分流技术,功能模块位于" => "eNodeB",
"根据参与话务分流的小区范围不同,负载均衡可以分为:基站内小区之间的负荷均衡、基站间的负荷均衡、MME之间的负荷均衡和" => "跨系统间的负荷均衡",
"评估负载均衡算法的好坏有三个维度:资源利用率、业务QoS满意率和" => "掉话率",
"根据UE和网络是否进行业务连接,可以把UE的状态分为两种:空闲状态和" => "连接状态",
"LTE的切换是硬切换还是软切换" => "硬切换",
"LTE切换流程可以简单第分为三个过程:切换准备、切换执行和" => "切换完成",
"中继技术(Relay)是什么标准的关键技术之一" => "LTE-A",
"RS的英文全称" => "Relay Station"
];
system("clear");
$name = readline("Input Your Exam Name(Like: 04-张三): ");
system("date");
$time_start = time();
$count = count($terms);
echo PHP_EOL;
echo "Hello, $name!";
echo PHP_EOL;
$line = "Init";
$i = 0;
// while ($term = current($terms)) {
// $key = key($terms);
while ($key = array_rand($terms)) {
$term = $terms[$key];
$i++;
while ($line !== $term) {
if ($line !== "Init") {
echo "Wrong! Try again!" . PHP_EOL;
}
$line = readline("$i/$count. $key: ");
}
echo "Good!";
$line = "Init";
echo PHP_EOL;
// next($terms);
unset($terms[$key]);
}
system("date");
$time_end = time();
echo PHP_EOL;
$seconds = $time_end - $time_start;
echo "$name, you finished the test in " . $seconds . " seconds!";
echo PHP_EOL;
echo "Great!!!";
echo PHP_EOL;
$content = "$name: $seconds seconds, " . date('Y-m-d H:i:s', $time_start) . ', ' . date('Y-m-d H:i:s', $time_end) . "\n";
file_put_contents('./' . basename(__FILE__, '.php') . '.log', $content, FILE_APPEND | LOCK_EX);
while (true) { readline(); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment