+ 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
22 Respuestas
+ 14
My try...work in progress
https://code.sololearn.com/cV2XQsDYYPVr/?ref=app
+ 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....
+ 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
+ 7
+ 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
+ 6
And my last one :p
https://code.sololearn.com/cND93iz5NVci/?ref=app
+ 5
nice one!!!
will try it
please can you give a short example by making a short code
+ 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 😃
+ 4
Nice.
+ 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.
+ 3
My simple attempt to Swiftly do Javascript:
https://code.sololearn.com/W2npR4j1E6ej/?ref=app
+ 3
@Pegasus
That's pretty good.
+ 3
Update: Removed the semicolons
+ 3
@Pegasus
Nice. We went from Android to JS, then JS to Swift. Not bad.
+ 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
+ 2
Unfortunally in PHP, you can't override the function print
https://code.sololearn.com/whARIqq9ttzv/?ref=app
+ 2
Yerucham's code became COTD!
+ 1
I think Baptiste E Prunier may a good one on Python in C++