assurance-tunnel
assurance-tunnel
assurance-tunnel
assurance-tunnel

Code Formatting for the Forum



  • Now we have a javascript actor can we have an option for submitting code in forum posts please?

    You've probably seen this in other forums - it would make any scripts look tidy and easier to copy and paste.

  • Tech Staff

    Good idea!


  • Tech Staff

    Yeah, I just saw your JS post @gavspav its needed.



  • Great idea!


  • Tech Staff

    Added pretty print. You can now add <code></code> and <pre></pre> tags. Though you have to switch to "show rich text" if you add the tags.

    function main()

    {

    var arr = []

    while(arr.length < 4){

    var randomnumber=Math.ceil(Math.random()*15)

    var found=false;

    for(var i=0;i<arr.length;i++){ if(arr[i]="=randomnumber){found=true;break}" }="" if(!found)arr[arr.length]="randomnumber;" return[arr[0],arr[1],arr[2],arr[3]]="" <="" code=""></arr.length;i++){>
    5be81a0c39a9b51739edde96db2c6f.png



  • Tried it but I can't get my head around it!

    Is there an icon I can press or something? Hate Html!

  • Tech Staff

    Just a quick test, with prettyprint class

    Using Code tag:
    function main(){ return arguments[0] + 1; }


    Using Pre tag:

    function main(){
    return arguments[0] + 1;
    }
    

    Just a quick test without prettyprint class.

    Using Code tag:
    function main(){ return arguments[0] + 1; }


    Using Pre tag:

    function main(){
    return arguments[0] + 1;
    }
    


  • I was just posting to say I still don't understand how to do this but I think I've got it now.

    You have to click the 'show source' icon which sometimes becomes the 'show rich text' icon?

    I'm just going to try it now

     If that's alright with you guys