math programming
If you make people think they’re thinking, they’ll love you. but if you really make them think, they’ll hate you.
~ Harlan Ellison
If you make people think they’re thinking, they’ll love you. but if you really make them think, they’ll hate you.
~ Harlan Ellison
EEEEE EEEEE EEEEE EEEEE EEEEE EEE
E E E E E EEE
EEE EEE EEE EEE EEE EE
E E E E E
EEEEE EEEEE EEEEE EEEEE EEEEE @
EEEEE EEEEE EEEEE EEEEE EEEEE EEE
E E E E E EEE
EEE EEE EEE EEE EEE EE
E E E E E
EEEEE EEEEE EEEEE EEEEE EEEEE @
lol i mean online like http://www.w3schools.com/
If you make people think they’re thinking, they’ll love you. but if you really make them think, they’ll hate you.
~ Harlan Ellison
EEEEE EEEEE EEEEE EEEEE EEEEE EEE
E E E E E EEE
EEE EEE EEE EEE EEE EE
E E E E E
EEEEE EEEEE EEEEE EEEEE EEEEE @
hey @roun512 , when u will find idea about maths programming , please text me about !!! good luck
what u need is what u get when u’re hacker !!! xx
well i mean if i got something like this
var foo = 5 + 6 * 7
var bar = foo % 8
var moo = bar * 2
var rar = moo / 3
function check(x)
{
if (x.length == moo)
{
alert("win!");
window.location += "?lvl_password="+x;
} else {
alert("fail D:");
}
}
how can i do math to know what is the pass
and iam not saying give me the pass but i want to know how do i do it
If you make people think they’re thinking, they’ll love you. but if you really make them think, they’ll hate you.
~ Harlan Ellison
Python:
#Simple calculator
def calc():
number1 = input("Enter your first number> ")
print(number1)
number2 = input("enter your second number> ")
print(number2)
op = raw_input("Enter an operator(+, -, /, *)> ")
if(op == "+"):
print(number1 + number2)
if(op == "-"):
print(number1 - number2)
if(op == "*"):
print(number1 * number2)
if(op == "/"):
print(number1 / number2)
calc()
enjoy.
Sail Safe.
Donations if possible: 1Cv4FrNBBF3LLjg6ceBBQQomKRTmzPNPFJ
@roun512 Debuggers like gdb or the one presents in visual studio and even firebug are here for that. Compute in your head or an a piece of paper might be funny at starts but in the end it does nothing more a debugger can’t already do for you and much more faster.
I suggest you to learn on how to use them and primary learn how to put breakpoints and how to read your var in live, you might have a revelation haha.
Your example is easy to solve by head but when you will have to face code like real level 3 and you want actually reverse it (for fun I guess), a debugger will definitely save your ass.
@Fromwarriors Exept the fact you missed the % operator, “That” is an ugly code like I don’t like to see one and I suggest you to have a look on function pointer or at least learn more keyword than the “if” statements, this code make too much jump for nothing. It’s not because computers are more and more strong that we shouldn’t care anymore on our code.
i think he wants to learn how to use logarithmic and computer science math for algorithims
if i am right roun get at me ill show u a little of what i know try to use set theory etc read about it or do you want statistical math?
i bake therefore im fried!!
If you make people think they’re thinking, they’ll love you. but if you really make them think, they’ll hate you.
~ Harlan Ellison
You should Google Search/Sorting algorithms. I would also make sure you are completely comfortable with how exponents and logarithms work. Here is some code I wrote in C# (Console App) while practicing for my programming mid term. One thing that helps me out when trying to figure out an algorithm is writing it down on paper first. Also, start out at the level of math you have completed. No sense in trying to code infinite geometric series or integrals when you are in high school algebra.
The first one calculates Pi. The amount of decimal places over depends on the number of iterations. You could try doing something similar with another irrational number, such as Phi.
```
public void Pi()
{
double pi = 4.0;
for (int i = 1; i <= 2730000; i += 4)//273000 � 3.14159
{
pi = pi - (4.0 / (i + 2.0)) + (4.0 / (i + 4.0));
Console.WriteLine("{0,4}", pi);
}
}
The second one is to determine if a number is prime (only divisible by one and itself), or composite.
public void Prime()
{
//prime if its greater than 1 and divisible only by 1 and itself
int prime;
bool np = false;
Console.WriteLine("Enter a number to determine if it is prime: ");
prime = Convert.ToInt32(Console.ReadLine());
for (int i = 2; i <= (prime - 1); i++)
{
if (prime % i == 0)
{
np = true;
break;
}
}
if (np == true)
{
Console.WriteLine("{0} is a composite number", prime);
}
else
{
Console.WriteLine("{0} is a prime number", prime);
}
}
```
Need help with math homework? Hit me up! I can help out with integral calculus and below.
Quite old topic brings back again hehe.
Just some remark on this:
1) First remark is, none of this short snippet has return and they actually print their results. That’s good for testing but don’t forget to adapt in real test application.
2) Still in real case environment, you might prefer use the constant System.Math.PI instead of getting one by computation.
3) Same as 2) on isprime, you might prefer more efficient algorithm: http://en.wikipedia.org/wiki/Sieve_of_Atkin //
http://en.wikibooks.org/wiki/Efficient_Prime_Number_Generating_Algorithms
I don’t disagree with anything you are saying, there are definitely faster and more efficient ways of doing things. However, I believe it is extremely helpful to know the derivation of the problem. I would never use type out my Pi example in a program, but actually solving it has helped me immensely with logic and visualization of an algorithm (which is probably why our teacher likes give us problems like this: ) ). I sort of equate it to calculus and it’s proving of theorems used in algebra/trig.
Great response though, some good points brought up Memoria!
Need help with math homework? Hit me up! I can help out with integral calculus and below.
That’s why I’ve mentioned “in real case environment” ^^.
You only learn the essence of programming by practicing more and more, there is no “shit” tests, they have to be done.
Need help with math homework? Hit me up! I can help out with integral calculus and below.