WeixiangYan/CodeTransOcean huggingface dataset:
Task: Cuban primes








VB: function isprime(v)
	if v mod 2 = 0 then return v = 2
	for d = 3 To Int(Sqr(v))+1 Step 2
		if v mod d = 0 then return false
	next d3
	return True
end function

function diff_cubes(n)
	return 3*n*(n+1) + 1
end function

function padto(n, s)
	outstr = ""
	k = length(string(n))
	for i = 1 to s-k
		outstr = " " + outstr
	next i
	return outstr + string(n)
end function

print "Los primeros 200 primos cubanos son: "

nc = 0
i = 1
while nc < 100000
	di = diff_cubes(i)
	if isprime(di) then
		nc += 1
		if nc <= 200 then
			print padto(di,8);" ";
			if nc mod 10 = 0 then print
		end if
		if nc = 100000 then
			print: print 
            print "El 100.000º primo cubano es ", di
			exit while
		end if
	end if
	i += 1
end while
Task: Vector








VB: Type vector
    x As Double
    y As Double
End Type
Type vector2
    phi As Double
    r As Double
End Type
Private Function vector_addition(u As vector, v As vector) As vector
    vector_addition.x = u.x + v.x
    vector_addition.y = u.y + v.y
End Function
Private Function vector_subtraction(u As vector, v As vector) As vector
    vector_subtraction.x = u.x - v.x
    vector_subtraction.y = u.y - v.y
End Function
Private Function scalar_multiplication(u As vector, v As Double) As vector
    scalar_multiplication.x = u.x * v
    scalar_multiplication.y = u.y * v
End Function
Private Function scalar_division(u As vector, v As Double) As vector
    scalar_division.x = u.x / v
    scalar_division.y = u.y / v
End Function
Private Function to_cart(v2 As vector2) As vector
    to_cart.x = v2.r * Cos(v2.phi)
    to_cart.y = v2.r * Sin(v2.phi)
End Function
Private Sub display(u As vector)
    Debug.Print "( " & Format(u.x, "0.000") & "; " & Format(u.y, "0.000") & ")";
End Sub
Public Sub main()
    Dim a As vector, b As vector, c As vector2, d As Double
    c.phi = WorksheetFunction.Pi() / 3
    c.r = 5
    d = 10
    a = to_cart(c)
    b.x = 1: b.y = -2
    Debug.Print "addition             : ";: display a: Debug.Print "+";: display b
    Debug.Print "=";: display vector_addition(a, b): Debug.Print
    Debug.Print "subtraction          : ";: display a: Debug.Print "-";: display b
    Debug.Print "=";: display vector_subtraction(a, b): Debug.Print
    Debug.Print "scalar multiplication: ";: display a: Debug.Print " *";: Debug.Print d;
    Debug.Print "=";: display scalar_multiplication(a, d): Debug.Print
    Debug.Print "scalar division      : ";: display a: Debug.Print " /";: Debug.Print d;
    Debug.Print "=";: display scalar_division(a, d)
End Sub
Task: Chebyshev coefficients








VB: 
  Dim coef(10),cheby(10)
  pi=4*Atn(1)
  a=0: b=1: n=10
  For i=0 To n-1
    coef(i)=Cos(Cos(pi/n*(i+1/2))*(b-a)/2+(b+a)/2)
  Next
  For i=0 To n-1
    w=0
    For j=0 To n-1
      w=w+coef(j)*Cos(pi/n*i*(j+1/2))
    Next
    cheby(i)=w*2/n
    If cheby(i)<=0 Then t="" Else t=" "
    WScript.StdOut.WriteLine i&" : "&t&cheby(i)
  Next
Task: Burrows–Wheeler transform








VB: Module Module1

    ReadOnly STX As Char = Chr(&H2)
    ReadOnly ETX As Char = Chr(&H3)

    Sub Rotate(Of T)(a As T())
        Dim o = a.Last
        For i = a.Length - 1 To 1 Step -1
            a(i) = a(i - 1)
        Next
        a(0) = o
    End Sub

    Private Function Compare(s1 As String, s2 As String) As Integer
        Dim i = 0
        While i < s1.Length AndAlso i < s2.Length
            Dim a = s1(i)
            Dim b = s2(i)
            If a < b Then
                Return -1
            End If
            If b < a Then
                Return 1
            End If
            i += 1
        End While
        If s1.Length < s2.Length Then
            Return -1
        End If
        If s2.Length < s1.Length Then
            Return 1
        End If
        Return 0
    End Function

    Function Bwt(s As String) As String
        If s.Any(Function(c) c = STX OrElse c = ETX) Then
            Throw New ArgumentException("Input can
        End If
        Dim ss = (STX + s + ETX).ToCharArray
        Dim table As New List(Of String)
        For i = 0 To ss.Length - 1
            table.Add(New String(ss))
            Rotate(ss)
        Next
        table.Sort(Function(a As String, b As String) Compare(a, b))
        Return New String(table.Select(Function(a) a.Last).ToArray)
    End Function

    Function Ibwt(r As String) As String
        Dim len = r.Length
        Dim sa(len - 1) As String
        Dim table As New List(Of String)(sa)
        For i = 0 To len - 1
            For j = 0 To len - 1
                table(j) = r(j) + table(j)
            Next
            table.Sort(Function(a As String, b As String) Compare(a, b))
        Next
        For Each row In table
            If row.Last = ETX Then
                Return row.Substring(1, len - 2)
            End If
        Next
        Return ""
    End Function

    Function MakePrintable(s As String) As String
        Return s.Replace(STX, "^").Replace(ETX, "|")
    End Function

    Sub Main()
        Dim tests As String() = {
            "banana",
            "appellee",
            "dogwood",
            "TO BE OR NOT TO BE OR WANT TO BE OR NOT?",
            "SIX.MIXED.PIXIES.SIFT.SIXTY.PIXIE.DUST.BOXES",
            STX + "ABC" + ETX
        }

        For Each test In tests
            Console.WriteLine(MakePrintable(test))
            Console.Write(" --> ")

            Dim t = ""
            Try
                t = Bwt(test)
                Console.WriteLine(MakePrintable(t))
            Catch ex As Exception
                Console.WriteLine("ERROR: {0}", ex.Message)
            End Try

            Dim r = Ibwt(t)
            Console.WriteLine(" --> {0}", r)
            Console.WriteLine()
        Next
    End Sub

End Module
Task: Addition chains








VB: Module Module1

    Function Prepend(n As Integer, seq As List(Of Integer)) As List(Of Integer)
        Dim result As New List(Of Integer) From {
            n
        }
        result.AddRange(seq)
        Return result
    End Function

    Function CheckSeq(pos As Integer, seq As List(Of Integer), n As Integer, min_len As Integer) As Tuple(Of Integer, Integer)
        If pos > min_len OrElse seq(0) > n Then
            Return Tuple.Create(min_len, 0)
        End If
        If seq(0) = n Then
            Return Tuple.Create(pos, 1)
        End If
        If pos < min_len Then
            Return TryPerm(0, pos, seq, n, min_len)
        End If
        Return Tuple.Create(min_len, 0)
    End Function

    Function TryPerm(i As Integer, pos As Integer, seq As List(Of Integer), n As Integer, min_len As Integer) As Tuple(Of Integer, Integer)
        If i > pos Then
            Return Tuple.Create(min_len, 0)
        End If

        Dim res1 = CheckSeq(pos + 1, Prepend(seq(0) + seq(i), seq), n, min_len)
        Dim res2 = TryPerm(i + 1, pos, seq, n, res1.Item1)

        If res2.Item1 < res1.Item1 Then
            Return res2
        End If
        If res2.Item1 = res1.Item1 Then
            Return Tuple.Create(res2.Item1, res1.Item2 + res2.Item2)
        End If

        Throw New Exception("TryPerm exception")
    End Function

    Function InitTryPerm(x As Integer) As Tuple(Of Integer, Integer)
        Return TryPerm(0, 0, New List(Of Integer) From {1}, x, 12)
    End Function

    Sub FindBrauer(num As Integer)
        Dim res = InitTryPerm(num)
        Console.WriteLine("N = {0}", num)
        Console.WriteLine("Minimum length of chains: L(n) = {0}", res.Item1)
        Console.WriteLine("Number of minimum length Brauer chains: {0}", res.Item2)
        Console.WriteLine()
    End Sub

    Sub Main()
        Dim nums() = {7, 14, 21, 29, 32, 42, 64, 47, 79, 191, 382, 379}
        Array.ForEach(nums, Sub(n) FindBrauer(n))
    End Sub

End Module
Task: Finite state machine








VB: Enum states
    READY
    WAITING
    DISPENSE
    REFUND
    QU1T
End Enum 
Public Sub finite_state_machine()
    Dim state As Integer: state = READY: ch = " "
    Do While True
        Debug.Print ch
        Select Case state
            Case READY:     Debug.Print "Machine is READY. (D)eposit or (Q)uit :"
                            Do While True
                                If ch = "D" Then
                                    state = WAITING
                                    Exit Do
                                End If
                                If ch = "Q" Then
                                    state = QU1T
                                    Exit Do
                                End If
                                ch = InputBox("Machine is READY. (D)eposit or (Q)uit :")
                            Loop
            Case WAITING:   Debug.Print "(S)elect product or choose to (R)efund :"
                            Do While True
                                If ch = "S" Then
                                    state = DISPENSE
                                    Exit Do
                                End If
                                If ch = "R" Then
                                    state = REFUND
                                    Exit Do
                                End If
                                ch = InputBox("(S)elect product or choose to (R)efund :")
                            Loop
            Case DISPENSE:  Debug.Print "Dispensing product..."
                            Do While True
                                If ch = "C" Then
                                    state = READY
                                    Exit Do
                                End If
                                ch = InputBox("Please (C)ollect product. :")
                            Loop
            Case REFUND:    Debug.Print "Please collect refund."
                            state = READY
                            ch = " "
            Case QU1T:      Debug.Print "Thank you, shutting down now."
                            Exit Sub
        End Select
    Loop
End Sub
Task: Reflection_List properties








VB: Imports System.Reflection

Module Module1

    Class TestClass
        Private privateField = 7
        Public ReadOnly Property PublicNumber = 4
        Private ReadOnly Property PrivateNumber = 2
    End Class

    Function GetPropertyValues(Of T)(obj As T, flags As BindingFlags) As IEnumerable
        Return From p In obj.GetType().GetProperties(flags)
               Where p.GetIndexParameters().Length = 0
               Select New With {p.Name, Key .Value = p.GetValue(obj, Nothing)}
    End Function

    Function GetFieldValues(Of T)(obj As T, flags As BindingFlags) As IEnumerable
        Return obj.GetType().GetFields(flags).Select(Function(f) New With {f.Name, Key .Value = f.GetValue(obj)})
    End Function

    Sub Main()
        Dim t As New TestClass()
        Dim flags = BindingFlags.Public Or BindingFlags.NonPublic Or BindingFlags.Instance
        For Each prop In GetPropertyValues(t, flags)
            Console.WriteLine(prop)
        Next
        For Each field In GetFieldValues(t, flags)
            Console.WriteLine(field)
        Next
    End Sub

End Module
Task: Base58Check encoding








VB: Imports System.Numerics
Imports System.Text

Module Module1
    ReadOnly ALPHABET As String = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
    ReadOnly HEX As String = "0123456789ABCDEF"

    Function ToBigInteger(value As String, base As Integer) As BigInteger
        If base < 1 OrElse base > HEX.Length Then
            Throw New ArgumentException("Base is out of range.")
        End If

        Dim bi = BigInteger.Zero
        For Each c In value
            Dim c2 = Char.ToUpper(c)
            Dim idx = HEX.IndexOf(c2)
            If idx = -1 OrElse idx >= base Then
                Throw New ArgumentException("Illegal character encountered.")
            End If
            bi = bi * base + idx
        Next

        Return bi
    End Function

    Function ConvertToBase58(hash As String, Optional base As Integer = 16) As String
        Dim x As BigInteger
        If base = 16 AndAlso hash.Substring(0, 2) = "0x" Then
            x = ToBigInteger(hash.Substring(2), base)
        Else
            x = ToBigInteger(hash, base)
        End If

        Dim sb As New StringBuilder
        While x > 0
            Dim r = x Mod 58
            sb.Append(ALPHABET(r))
            x = x / 58
        End While

        Dim ca = sb.ToString().ToCharArray()
        Array.Reverse(ca)
        Return New String(ca)
    End Function

    Sub Main()
        Dim s = "25420294593250030202636073700053352635053786165627414518"
        Dim b = ConvertToBase58(s, 10)
        Console.WriteLine("{0} -> {1}", s, b)

        Dim hashes = {"0x61", "0x626262", "0x636363", "0x73696d706c792061206c6f6e6720737472696e67", "0x516b6fcd0f", "0xbf4f89001e670274dd", "0x572e4794", "0xecac89cad93923c02321", "0x10c8511e"}
        For Each hash In hashes
            Dim b58 = ConvertToBase58(hash)
            Console.WriteLine("{0,-56} -> {1}", hash, b58)
        Next
    End Sub

End Module
Task: XML validation








VB: Option explicit

Function fileexists(fn) 
  fileexists= CreateObject("Scripting.FileSystemObject").FileExists(fn)
End Function

Function xmlvalid(strfilename)
  Dim xmldoc,xmldoc2,objSchemas 
  Set xmlDoc = CreateObject("Msxml2.DOMDocument.6.0")
  
  If fileexists(Replace(strfilename,".xml",".dtd")) Then
    xmlDoc.setProperty "ProhibitDTD", False
    xmlDoc.setProperty "ResolveExternals", True 
    xmlDoc.validateOnParse = True
    xmlDoc.async = False
    xmlDoc.load(strFileName)
  ElseIf fileexists(Replace(strfilename,".xml",".xsd")) Then
    xmlDoc.setProperty "ProhibitDTD", True
    xmlDoc.setProperty "ResolveExternals", True 
    xmlDoc.validateOnParse = True
    xmlDoc.async = False
    xmlDoc.load(strFileName)
    
    
    Set xmlDoc2 = CreateObject("Msxml2.DOMDocument.6.0")
    xmlDoc2.validateOnParse = True
    xmlDoc2.async = False
    xmlDoc2.load(Replace (strfilename,".xml",".xsd"))
    
    
    Set objSchemas = CreateObject("MSXML2.XMLSchemaCache.6.0")
    objSchemas.Add "", xmlDoc2
  Else 
    Set xmlvalid= Nothing:Exit Function
  End If
  
  Set xmlvalid=xmldoc.parseError 
End Function



Sub displayerror (parserr) 
  Dim strresult
  If parserr is Nothing Then 
    strresult= "could not find dtd or xsd for " & strFileName
  Else   
    With parserr
     Select Case .errorcode
      Case 0 
        strResult = "Valid: " & strFileName & vbCr
      Case Else
        strResult = vbCrLf & "ERROR! Failed to validate " & _
        strFileName & vbCrLf &.reason & vbCr & _
        "Error code: " & .errorCode & ", Line: " & _
        .line & ", Character: " & _
        .linepos & ", Source: """ & _
        .srcText &  """ - " & vbCrLf 
 
      End Select
    End With
  End If
  WScript.Echo strresult
End Sub


Dim strfilename






strfilename="shiporder.xml"
displayerror xmlvalid (strfilename)
Task: Execute HQ9+



C#: using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void RunCode(string code)
    {
        int accumulator = 0;
        var opcodes = new Dictionary<char, Action>
        {
            {'H', () => Console.WriteLine("Hello, World!"))},
            {'Q', () => Console.WriteLine(code) },
            {'9', () => Console.WriteLine(Enumerable.Range(1,100).Reverse().Select(n => string.Format("{0} bottles of beer on the wall\n{0} bottles of beer\nTake one down, pass it around\n{1} bottles of beer on the wall\n", n, n-1)).Aggregate((a,b) => a + "\n" + b))},
            {'+', () => accumulator++ }
        }

        foreach(var c in code)
            opcodes[c]();
    }
}








Fortran: "bottle" // IF (B.NE.1) THEN "s" FI // " of beer"
Task: Playing cards



C#: using System;
using System.Linq;
using System.Collections.Generic;

public struct Card
{
    public Card(string rank, string suit) : this()
    {
        Rank = rank;
        Suit = suit;
    }

    public string Rank { get; }
    public string Suit { get; }

    public override string ToString() => $"{Rank} of {Suit}";
}

public class Deck : IEnumerable<Card>
{
    static readonly string[] ranks = { "Two", "Three", "Four", "Five", "Six",
        "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King", "Ace" };
    static readonly string[] suits = { "Clubs", "Diamonds", "Hearts", "Spades" };
    readonly List<Card> cards;
 
    public Deck() {
        cards = (from suit in suits
                from rank in ranks
                select new Card(rank, suit)).ToList();
    }

    public int Count => cards.Count;

    public void Shuffle() {
        
        var random = new Random();
        for (int i = 0; i < cards.Count; i++) {
            int r = random.Next(i, cards.Count);
            var temp = cards[i];
            cards[i] = cards[r];
            cards[r] = temp;
        }
    }

    public Card Deal() {
        int last = cards.Count - 1;
        Card card = cards[last];
        
        
        cards.RemoveAt(last);
        return card;
    }

    public IEnumerator<Card> GetEnumerator() {
        
        
        for (int i = cards.Count - 1; i >= 0; i--)
            yield return cards[i];
    }

    System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => GetEnumerator();
}








Fortran: MODULE Cards

IMPLICIT NONE

  TYPE Card
    CHARACTER(5) :: value
    CHARACTER(8) :: suit
  END TYPE Card

  TYPE(Card) :: deck(52), hand(52)
  TYPE(Card) :: temp

  CHARACTER(5) :: pip(13) = (/"Two  ", "Three", "Four ", "Five ", "Six  ", "Seven", "Eight", "Nine ", "Ten  ", &
                              "Jack ", "Queen", "King ", "Ace  "/)
  CHARACTER(8) :: suits(4) = (/"Clubs   ", "Diamonds", "Hearts  ", "Spades  "/)
  INTEGER :: i, j, n, rand, dealt = 0
  REAL :: x

CONTAINS
 
  SUBROUTINE Init_deck
  
    DO i = 1, 4
      DO j = 1, 13
        deck((i-1)*13+j) = Card(pip(j), suits(i))
      END DO
    END DO
  END SUBROUTINE Init_deck
 
  SUBROUTINE Shuffle_deck
  
    DO i = 52-dealt, 1, -1
      CALL RANDOM_NUMBER(x)
      rand = INT(x * i) + 1
      temp = deck(rand)
      deck(rand) = deck(i)
      deck(i) = temp
    END DO
  END SUBROUTINE Shuffle_deck

  SUBROUTINE Deal_hand(number)
  
    INTEGER :: number
    DO i = 1, number
      hand(i) = deck(dealt+1)
      dealt = dealt + 1
    END DO
  END SUBROUTINE

  SUBROUTINE Print_hand
  
    DO i = 1, dealt
      WRITE (*, "(3A)") TRIM(deck(i)%value), " of ", TRIM(deck(i)%suit)
    END DO
    WRITE(*,*)
  END SUBROUTINE Print_hand
 
  SUBROUTINE Print_deck
  
    DO i = dealt+1, 52
      WRITE (*, "(3A)") TRIM(deck(i)%value), " of ", TRIM(deck(i)%suit)
    END DO
    WRITE(*,*)
  END SUBROUTINE Print_deck

END MODULE Cards
Task: Two sum



C#: using System;
using System.Collections.Generic;

public class Program
{
    public static void Main(string[] args)
    {
        int[] arr = { 0, 2, 11, 19, 90 };
        const int sum = 21;

        var ts = TwoSum(arr, sum);
        Console.WriteLine(ts != null ? $"{ts[0]}, {ts[1]}" : "no result");

        Console.ReadLine();
    }

    public static int[] TwoSum(int[] numbers, int sum)
    {
        var map = new Dictionary<int, int>();
        for (int i = 0; i < numbers.Length; i++)
        {
            
            var key = sum - numbers[i];
            if (map.ContainsKey(key))
            {
                return new[] { map[key], i };
            }
            map.Add(numbers[i], i);
        }
        return null;
    }
}








Fortran: program twosum
  implicit none

  integer, parameter, dimension(5) :: list = (/ 0, 2, 11, 19, 90/)
  integer, parameter :: target_val = 21
  integer :: nelem
  integer :: i, j
  logical :: success = .false.

  nelem = size(list)
  outer:do i = 1,nelem
     do j = i+1,nelem
        success = list(i) + list(j) == target_val
        if (success) exit outer
     end do
  end do outer

  if (success) then
     
     print('("(",2(i3.1,1X),")",3(A1,i3.1))'), i,j, ":", list(i), "+", list(j), "=", target_val
  else
     print*, "Failed"
  end if

end program twosum
Task: Find the last Sunday of each month



C#: using System;

namespace LastSundayOfEachMonth
{
    class Program
    {
        static void Main()
        {
            Console.Write("Year to calculate: ");

            string strYear = Console.ReadLine();
            int year = Convert.ToInt32(strYear);

            DateTime date;
            for (int i = 1; i <= 12; i++)
            {
                date = new DateTime(year, i, DateTime.DaysInMonth(year, i), System.Globalization.CultureInfo.CurrentCulture.Calendar);
                
                
                int daysOffset = date.DayOfWeek - dayOfWeek; 
                if (daysOffset < 0) daysOffset += 7; 
                date = date.AddDays(-daysOffset ); 
                Console.WriteLine(date.ToString("yyyy-MM-dd"));
            }
        }
    }
}








Fortran:       D = DAYNUM(Y,M,D)    
      DAYNUM(Y,M,D) = D
Task: I before E except after C



C#: using System;
using System.Collections.Generic;
using System.IO;

namespace IBeforeE {
    class Program {
        static bool IsOppPlausibleWord(string word) {
            if (!word.Contains("c") && word.Contains("ei")) {
                return true;
            }
            if (word.Contains("cie")) {
                return true;
            }
            return false;
        }

        static bool IsPlausibleWord(string word) {
            if (!word.Contains("c") && word.Contains("ie")) {
                return true;
            }
            if (word.Contains("cei")) {
                return true;
            }
            return false;
        }

        static bool IsPlausibleRule(string filename) {
            IEnumerable<string> wordSource = File.ReadLines(filename);
            int trueCount = 0;
            int falseCount = 0;

            foreach (string word in wordSource) {
                if (IsPlausibleWord(word)) {
                    trueCount++;
                }
                else if (IsOppPlausibleWord(word)) {
                    falseCount++;
                }
            }

            Console.WriteLine("Plausible count: {0}", trueCount);
            Console.WriteLine("Implausible count: {0}", falseCount);
            return trueCount > 2 * falseCount;
        }

        static void Main(string[] args) {
            if (IsPlausibleRule("unixdict.txt")) {
                Console.WriteLine("Rule is plausible.");
            }
            else {
                Console.WriteLine("Rule is not plausible.");
            }
        }
    }
}








Fortran: 













program cia
  implicit none
  character (len=256) :: s
  integer :: ie, ei, cie, cei
  integer :: ios
  data ie, ei, cie, cei/4*0/
  do while (.true.)
    read(5,*,iostat = ios)s
    if (0 .ne. ios) then
      exit
    endif
    call lower_case(s)
    cie = cie + occurrences(s, 'cie')
    cei = cei + occurrences(s, 'cei')
    ie = ie + occurrences(s, 'ie')
    ei = ei + occurrences(s, 'ei')
  enddo
  write(6,'(1x,4(a4,1x))') 'ie','ei','cie','cei'
  write(6,'(1x,4(i4,1x))') ie,ei,cie,cei 
  write(6,'(1x,2(a,1x))') '        [^c]ie',plausibility(ie,ei)
  write(6,'(1x,2(a,1x))') '           cei',plausibility(cei,cie)
  write(6,'(1x,2(a,1x))') '([^c]ie)|(cei)',plausibility(ie+cei,ei+cie)

contains

  subroutine lower_case(s)
    character(len=*), intent(inout) :: s
    integer :: i
    do i=1, len_trim(s)
      s(i:i) = achar(ior(iachar(s(i:i)),32))
    enddo
  end subroutine lower_case

  integer function occurrences(a,b)
    character(len=*), intent(in) :: a, b
    integer :: i, j, n
    n = 0
    i = 0
    j = index(a, b)
    do while (0 .lt. j)
      n = n+1
      i = i+len(b)+j-1
      j = index(a(i:), b)
    end do
    occurrences = n
  end function occurrences

  character*(32) function plausibility(da, nyet)
    integer, intent(in) :: da, nyet
    
    if (nyet*2 .lt. da) then
      plausibility = 'plausible'
    else
      plausibility = 'implausible'
    endif
  end function plausibility
end program cia
Task: Naming conventions



C#: public enum Planet {
    Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune
}

[Flags]
public enum Days {
    None = 0,
    Sunday = 1,
    Monday = 2,
    Tuesday = 4,
    Wednesday = 8,
    Thursday = 16,
    Friday = 32,
    Saturday = 64,
    Workdays = Monday | Tuesday | Wednesday | Thursday | Friday
    AllWeek = Sunday | Saturday | Workdays
}








Fortran: IMPLICIT REAL(A-H,O-Z), INTEGER(I-M)