xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Interview of Chinese IT companies Ratings and Reviews website/app

Interview of Chinese IT companies Ratings and Reviews website/app

💩💩💩💩💩
👍👍👍👍👍
👎👎👎👎👎

// js hack

const getShitRank = (strings, ...values) => {
   let str = `★★★★★☆☆☆☆☆`;
   const rate = values[0] || 0;
   if(strings[0]) {
     str = strings[0];
   }
   return str.slice(5 - rate, 10 - rate);;
}

getShitRank`👍👍👍👍👍👎👎👎👎👎${1}`;
getShitRank`💩💩💩💩💩👎👎👎👎👎 ${1}`;
getShitRank`🍅🍅🍅🍅🍅💩💩💩💩💩 ${1}`;

emoji bug

Unicode bug???

// emoji bug
`🍅🍅🍅🍅🍅💩💩💩💩💩`.slice(4, 9)
// "🍅🍅�"
`🍅🍅🍅🍅🍅⭐️⭐️⭐️⭐️⭐️`.slice(4, 9)
// "🍅🍅�"

`★★★★★☆☆☆☆☆`.slice(4, 9)
// "★☆☆☆☆"

solution OK


const getShitRanking = (strings, ...values) => {
   const rate = values[0] || 0;
   let str = `★★★★★☆☆☆☆☆`;
   let start = 5 - rate;
   let end = 10 - rate;
   if(strings[0]) {
     str = strings[0].trim();
     start = (5 - rate) * (Math.ceil(str.length/10));
     end = (10 - rate) * (Math.ceil(str.length/10));
   }
   return str.slice(start, end);;
}


getShitRank`👍👍👍👍👍👎👎👎👎👎${1}`;
// "👍👎👎👎👎"
getShitRank`💩💩💩💩💩👎👎👎👎👎 ${1}`;
// "💩👎👎👎👎"
getShitRank`🍅🍅🍅🍅🍅💩💩💩💩💩 ${1}`;
// "🍅💩💩💩💩"

refs

Rotten Tomatoes (烂番茄)

https://www.rottentomatoes.com/

两种评分体系:

TOMATOMETER® 番茄值 --- 对应专业评审评分

AUDIENCE SCORE 爆米花值 --- 对应普通观众评分

https://www.jianshu.com/p/32efef9d9714

douban 豆瓣



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


posted @ 2020-07-04 12:36  xgqfrms  阅读(203)  评论(16编辑  收藏  举报