+ 22

💎 CHALLENGE #different language💎

Your aim is to write a code in a language that implements and uses functions and methods from another language. For Example: #c++ int main(){ document.write("javascript"); } In the write method there should be something like: string write(string input){ cout<<input ; } you have to take functions and methods from other languages! #Whoever manages to use the most complex methods and functions from other languages wins🎆🎆🎆 https://code.sololearn.com/c8rKdQx6ivz7/?ref=app

25th Nov 2017, 4:45 PM
᠌᠌Code X
᠌᠌Code X - avatar
22 Respostas
25th Nov 2017, 9:14 PM
David Akhihiero
David Akhihiero - avatar
+ 8
greatest possible idea....good question.... many are saying sololearn is for beginners but these type of questions make it for moderate or a little bit advanced....
25th Nov 2017, 6:23 PM
SAKSHI
SAKSHI - avatar
+ 7
hmmm nice Mustafa something more complex like System.out.println will do you have to define a System object,a "out" property and a "println()" method for it
25th Nov 2017, 5:22 PM
᠌᠌Code X
᠌᠌Code X - avatar
25th Nov 2017, 10:16 PM
᠌᠌Code X
᠌᠌Code X - avatar
+ 7
True. Quite a good experience for someone who usually makes Python codes. I tried doing Java before seeing Yerucham's attempt. I could try C# too for a Python code BTW here is Baptiste's attempt for Python in C++: https://code.sololearn.com/cXMl6OQ149x0/?ref=app
26th Nov 2017, 2:04 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
26th Nov 2017, 9:52 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 5
nice one!!! will try it please can you give a short example by making a short code
25th Nov 2017, 4:58 PM
Saurabh Tiwari
Saurabh Tiwari - avatar
+ 4
im using c++, for example you know we use print() function in python. Should I overload print function to print something? void print(string x){ cout<< x; } void print(int x){ cout<< x; } . . . If like that I think hard challenge or Idk many things about programming 😃
25th Nov 2017, 5:17 PM
Mustafa K.
Mustafa K. - avatar
+ 4
Nice.
26th Nov 2017, 2:06 AM
Jacob Duelz
Jacob Duelz - avatar
+ 3
My Java(Script) implementation (untested). This is for Android. public class document extends Activity{ public static String getElementById(String a){ String b="R.Id."+a; String c="(TextView)findViewById("+a+");"; return c; } public void main(){ final TextView tv=document.getElementById("textView"); } } ... In another XML file... <TextView ... android:id="@+id/textView /> ... This is Android programming, but it's very similar to the relationship between HTML and JavaScript. This can be useful for getting values from different elements, especially fields.
26th Nov 2017, 1:30 AM
Jacob Duelz
Jacob Duelz - avatar
+ 3
My simple attempt to Swiftly do Javascript: https://code.sololearn.com/W2npR4j1E6ej/?ref=app
26th Nov 2017, 1:56 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 3
@Pegasus That's pretty good.
26th Nov 2017, 1:58 AM
Jacob Duelz
Jacob Duelz - avatar
+ 3
Update: Removed the semicolons
26th Nov 2017, 2:01 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 3
@Pegasus Nice. We went from Android to JS, then JS to Swift. Not bad.
26th Nov 2017, 2:02 AM
Jacob Duelz
Jacob Duelz - avatar
+ 3
Thanks @Pegasus for my register 😂 When I saw @Yerucham code, I told to myself "I already did something like that !" Then I saw the best answer and was like "wait ... what ? :o" Here is another attempt, C++ new and delete in C :) https://code.sololearn.com/ctaBYdlTM5rP/?ref=app
26th Nov 2017, 8:24 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 2
Unfortunally in PHP, you can't override the function print https://code.sololearn.com/whARIqq9ttzv/?ref=app
25th Nov 2017, 11:25 PM
Kirill Vercetti
Kirill Vercetti - avatar
+ 2
Yerucham's code became COTD!
27th Nov 2017, 1:37 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 1
I think Baptiste E Prunier may a good one on Python in C++
26th Nov 2017, 12:29 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar