jhannes / extreme_startup Goto Github PK
View Code? Open in Web Editor NEWThis project forked from rchatley/extreme_startup
This project forked from rchatley/extreme_startup
See if the sleep can be reduced dramatically when there's 20 players. Maybe sleep time of 1 second, both for ok and failed questions.
Add some questions that will trip a correct, but slow implementation up.
Code from server:
def correct_answer
n = which_number
root5 = Math.sqrt(5)
phi = 0.5 + root5/2
Integer(0.5 + phi**n/root5)
end
This fails miserably on larger fibonaccis due to precision issues. sqrt(5) is an irrational number, its precision is calculated to over 1 mill decimals. Ruby float: Math.sqrt(5) == 2.23606797749979
is just too imprecise.
It actually fails already with fib(71):
def gr_fib(n)
root5 = Math.sqrt(5)
phi = 0.5 + root5/2
Integer(0.5 + phi**n/root5)
end
>> (69...72).map { |n| gr_fib n }
=> [117669030460994, 190392490709135, 308061521170130]
>> 117669030460994+190392490709135
=> 308061521170129
I suggest you use an iterative version instead. For instance:
def fib(n)
a, b = 0, 1
(0...n).each { |_| a, b = b, a + b }
a
end
After a question has been answered correctly 10x times, reduce score to 10%
After a question has been answered incorrectly 10x times and never correctly, reduce penalty to 1% of base score
After a question has been answered correctly, increase the penalty to 20%
An error in a question should never make the server crash!
When user has responded to warmup question, automatically provide a few more.
Also: Make the display show which users have never answered a question correctly
"You depart CPH for OSL at 2011-10-28 23:00. Flight time is 3 hrs, 30 minutes. When do you arrive?"
Add a question that sometimes don't have an answer. Learning benefit: "Sometimes, the customer will never be happy. You have to ignore the haters and move on".
Some of these questions may make the server bomb
Possible:
Log a session in such a way that we can look at what happened to an individual player and what questions got answered wrong and right. Log files should automatically be unique after a restart.
In order to specialize in different parts of the game, as a player, I want the game to introduce more questions in the areas of the game where I've made progress.
extreme_startup/lib/extreme_startup/question.rb:73:in `log_result': undefined method `[]' for nil:NilClass (NoMethodError)
from extreme_startup/lib/extreme_startup/quiz_master.rb:82:in `start'
from extreme_startup/lib/extreme_startup/web_server.rb:115:in `block (2 levels) in <class:WebServer>'
Reproduce:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.